views:

2135

answers:

5

I want to build a site where the user can enter text and format it in Markdown. The reason I'd like a Javascript solution is because I want to display a live preview, just like on StackOverflow.

My site is not targeted at developers, however, so an editor control would be ideal.

I gather that on StackOverflow, the WMD editor is being used.

A quick search on Google also turns up Showdown library, which I think is actually being used by WMD.

Are there any other options? Are WMD/Showdown great tools already? What have been your experiences with the different options?

Thanks!

+3  A: 

As far as I know there really isn't any other browser-based editor for Markdown, at least none as extensive as the WMD editor.

Showdown is a Markdown converter in JS, which forms the basis for the HTML preview of WMD. They're both made by http://attacklab.net/.

And as far as I know there haven't been any big complaints about both (at least not on the Markdown mailing list). So go for it.

_Lasar
+1  A: 

I've not tested this, but here is another option:

Markdown wysiwyg

VirtuosiMedia
+11  A: 

We've been pretty happy with WMD. There are a few niggling bugs in it, however. Nothing major, but I would love if John Fraser (the author) made the code open source so we can fix some of them. He's promised to do so but other real life projects are getting in the way.

I do follow up with John every week. I'll post on the blog once the WMD source is finally available.

Jeff Atwood
Thanks for the answer Jeff. I didn't even realize WMD wasn't open source... I'll keep my eyes peeled.
webmat
What did you do about the gaping security hole?For example:<div onmouseover="alert('hi');">hi</div>The above works in the WMD demo!
superjoe30
+4  A: 

If you're not adverse to using Ajax to generate the live preview, then another option is markItUp!. markItUp! is a universal markup-editor, and very flexible. It does provide an easy way of creating a markup editor, but unlike WMD, it doesn't provide its own live preview.

I used markItUp!, along with a simple JSP (using MarkdownJ) for one of my open-source projects (a Markdown plugin for Roller). If you're using another server-side technology, replace that simple JSP as appropriate.

I actually starting using this before I came across WMD. I'd agree, WMD is great, but has only just been open-sourced and is, at this stage, more difficult to customize the behavior of.

myabc
A: 

if you are using .net, use "MarkDown.NET"

DucDigital
Not Javascript...
strager