Suppose I have the following HTML on the page:
<div id="Test">
One
Two
</div>
and this jQuery:
var contents=$("div#Test").html()
In Chrome and Firefox, the resulting string contents
includes line breaks - that is, between "One" and "Two" there's character code 10. In IE, though, it seems to collapse any white space and line feeds to a single space (character code 32).
I want to take contents
and pass it to a Markdown engine, so I need the whitespace and linefeeds to come through as is. How can I do this?