micromarkdown.js
micromarkdown.js copied to clipboard
HTML not being escaped at all!
Oh dear, this is a pretty fundamental lack of reading of the markdown spec or lack of understanding of html.
If you write this markdown[1]:
wibble & wobble 4 < 5
it should translate as
wibble & wobble 4 < 5
but it doesn't, so generates incorrect HTML.
If you're going to try to sort this using pattern matching, don't forget that the document might end with an ampersand or less-than. Given that, while less-than need not be escaped inside attribute values, it does no harm either, there may be a common pattern matching solution for general text and ampersand inside attributes (but not for double quotes inside attributes, I think).
[1] https://daringfireball.net/projects/markdown/syntax#autoescape
The title was perhaps rather extreme, sorry. Changed to be more accurate.