It should be easy (at least it looks like someone else doesn't have a similar problem), but I don't see where it breaks.
I save the Markdown'ed text in the database, which is entered on the page of my application. The text is entered using WMD and the live view looks right.
On another page, I extract the markup text and using Showdown.js to convert it back to an HTML client for display.
Let's say I have this text:
The quick **brown** fox jumped over the *lazy* dogs. 1. one 1. two 4. three 17. four
I use this javascript snippet in my jQuery ready event to convert it:
var sd = new Attacklab.showdown.converter(); $(".ClassOfThingsIWantConverted").each(function() { this.innerHTML = sd.makeHtml($(this).html()); }
I suspect this is my problem, but it almost works.
In FireFox, I get what I expected:
A quick brown fox jumped over the lazy dogs.
But in IE (7 and 6) I get the following:
A quick brown fox jumped over the lazy dogs. 1. one 1. two 4. three 17. four
So, apparently, IE removes the gaps in my code and just converts them to spaces. When I make the source code (before the script is run), the gaps are inside the DIV container.
What am I doing wrong?
UPDATE
This is caused by quirk IE innerHTML / innerText, and I should have mentioned before that this one on an ASP.Net page using data-bound controls - otherwise, obviously, there are many different workarounds.