I'm using this jQuery markdown for my pages. The jQuery code is as follows:
var converter = new Markdown.Converter();
$(document).ready(function(e) {
$('#content').html( converter.makeHtml($('#content').html()) );
/* and some more */
});
This has been working perfectly. None of my pages had a blockquote
until now. Today, I tried using a blockquote
content and the page isn't parsing the HTML correctly.
The text is stored inside a MySQL table. Consider the following:
Just some
> random blockquote content. let's see if it works or not
This text is shown correctly on the markdown editor box:
But when opening it as a web-page (I use Opera; but the problem is still there in all other browsers, namely Firefox, Chrome and IE)
P.S.: All images are thumbnails. Click for larger size.
Thanks to @Jay I've found a solution to the problem.
Instead of using .html()
in the converter, it performs perfectly with .text()
.
var converter = new Markdown.Converter();
$(document).ready(function(e) {
$('#content').html( converter.makeHtml($('#content').text()) );
/* and some more --------------------- RIGHT HERE >>>^ */
});
Here is the updated fiddle: http://jsfiddle.net/atdEP/1/