WMD automatically populates the preview element as you type, right? Well, it needs to have a converter somewhere to do this. That converter is Showdown (which you could obtain here). Here is its usage (pulled from the source file):
// Showdown usage:
var text = "Markdown *rocks*.";
var converter = new Showdown.converter();
var html = converter.makeHtml(text);
This means that you can simply not use the preview element that is provided, in favor of your own that you populate yourself. Furthermore, you will need to listen to the keypress
event on the textarea yourself and do your parsing of the text, followed by calling Showdown. When the output is as you like it, throw it into your own preview element.
geowa4
2009-10-15 20:29:27