Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you store the markdown using WMD in ASP.NET?

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?

like image 353
mattruma Avatar asked Sep 23 '08 16:09

mattruma


1 Answers

Before you include wmd.js, or whatever you've named the WMD editor JavaScript code locally, add one line of JavaScript code:

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

This will force the output of the editor to Markdown.

like image 150
Clinton Dreisbach Avatar answered Oct 28 '22 10:10

Clinton Dreisbach