Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown for .NET? How does SO render it on the fly?

I'm just getting into Markdown and think it's the bee's knees. I'm working in ASP.NET (MVC) and am wondering if there are any good .NET libraries for Markdown, and am also curious how SO renders it on the fly. It must be a JavaScript library.

like image 427
devios1 Avatar asked Mar 26 '09 00:03

devios1


1 Answers

StackOverflow uses Attacklab's WMD, a Markdown editor. It takes care of all the on-the-fly rendering. This is the relevant snippet of code in the StackOverflow page source that does the styling magic.

    var jWmd = $("#wmd-input");
    jWmd.not(".processed").TextAreaResizer();
    jWmd.typeWatch( { highlight:false, wait:5000, captureLength: 5, callback:styleCode } );
    jWmd.rules("add", { required: true, minlength: 10 });
like image 146
John Feminella Avatar answered Oct 15 '22 05:10

John Feminella