I have implemented the WMD control that Stack Overflow uses into a project of mine, it almost works like a charm, but when I save the changes to the database it is saving the HTML version and not the Markdown version.
So where I have this in my text box:
**boldtext**
It is really saving this:
<b>boldtext</b>
How do I make it save the Markdown version?
Before you include
wmd.js
, or whatever you've named the WMD editor JavaScript code locally, add one line of JavaScript code:This will force the output of the editor to Markdown.
If you're using the new WMD from http://code.google.com/p/wmd-new/, open wmd.js and add this line:
Excerpt:
That should do the trick.