Hacker News new | ask | show | jobs
by Navarr 4411 days ago
Considering you have to run any markdown parser through a sanitizer, the speed improvements still matter.
1 comments

The markdown parser should be able to do it in an ideal world. Htmlpurifier is very slow.

edit:

To whoever downvoted me, I'm sorry, was I wrong? The markdown parser has to look at every input byte, obviously it's better to do the HTML sanitation at this level because the HTML parser must also look at every input byte, so, combine them into one pass...

Running HTMLPurifier on the output of the markdown parser is inefficient - it's sanitizing known good elements not just the potentially bad ones, so you're giving it more work to do.