views:

628

answers:

1

I have implemented the WMD control that StackOverflow 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>

Any ideas how to make it so the markdown version is saved?

+6  A: 

Before you include wmd.js, or whatever you've named the WMD Editor Javascript locally, add one line of JS:

wmd_options = {"output": "Markdown"};

This will force the output of the editor to Markdown.

Clinton R. Nixon
Worked like a charm! Thank you!
mattruma
using this, can you have it output both the markdown AND the html?
Ryan Guill