views:

630

answers:

4

What is a good open source .NET library to convert markdown to HTML on the server?

If this has been answered somewhere else please point me to the post. Thanks.

+1  A: 

On ASP.NET Resources you can find the Markdown.Net library by Milan Negovan:

http://www.aspnetresources.com/blog/markdown_announced.aspx

splattne
+5  A: 

Markdown.Net. It hasn't been developed since 2004 it appears. A revised coverage fixing some of its problems can be found here : http://www.brianjeremy.com/2007/12/07/revisied-markdownnet-library/

Jonathan Sampson
A: 

Off topic:

Maybe you are looking for something like Markdown. So you could consider using Textile:

Textile.NET is, surprisingly, a textile formatter for .NET projects. Textile is a "human web text generator" that is useful for rapid web writings such as Wiki syntax or blog articles. From a simple and intuitive syntax it creates well formed HTML with advanced formatting features, while also allowing the user to customize the output.

  • Replace single and double primes (' and ") used as quotation marks with HTML entities for opening and closing quotation marks (‘’ and “”) in readable text, while leaving untouched the primes required within HTML tags.
  • Replace double hyphens (--) with an em-dash (—) entity.
  • Replace single hyphens surrounded by spaces with an en-dash (–) entity.
  • Replace triplets of periods (...) with an ellipsis (…) entity.
  • Convert many nonstandard characters (ŸúߊπŒ) to browser-safe entities corresponding to keyboard input.
  • Apply block- and phrase-level structural tags automatically and at the discretion of the writer via quick tags.
  • Allow the quick creation of simple and complex tables
  • Allow the simple application of style, class, id, language and alignment attributes to elements
  • Create hyperlinks and insert images via quick tags.
  • Define acronyms via quick tags
  • Wrap an tag around runs of three or more capital letters automatically.
  • Convert (TM), (R), and (C) to ™, ®, and ©
  • Convert the letter x to a dimension sign: 2x4 to 2×4 and 8 x 10 to 8×10
splattne
I like some of these features... but I'm not sure I would want em-dash and en-dashes. This makes me think of the way Outlook and WordPress replace plain old " with 'pretty quotes'. I can't stand that. And its quite hackish the way you have to disable this in WP. I can't believe its on by default.
tyndall
But I guess markup languages are just like computer languages... some features you like, some you don't. You'll never find one that you agree with 100% of the design choices.
tyndall
+2  A: 

Check out Markdown Sharp. It's the open source library that resulted from the development of Stack Overflow and is much more robust/actively developed than markdown.net.

Drew Noakes
I'm glad that I looked at this question again, this is definitely more useful that the other libraries mentioned.
Redbeard 0x0A