erusev/parsedown — pull request #181 by naNuke (2014-06-02 06:48:05+00:00)
Title: HtmlEscaping and SafeLinks

Hello, I just started using parsedown in my project and love it very much! But since I needed html escaping I made some modifications that I use at the moment. I know that this is already discussed in issue list and possibly being already worked on but I want to share my code just in case it might come in handy.

I tried to stay as much in style of parsedown code as I could.

Also I am sorry that I am not providing test cases for this, but I never worked with any tests and would possibly do it wrong.

1. The html escaping works simply by providing another identifier for > character in spanTypes and disabling all identifiers for tag, comments and markup handling.
2. The safe links just check if there is 'javascript:' inside link url.

I did quite bit of testing with various markdown texts and all seem to work properly and by trying to understand the parsedown code, I don't see a reason why this method of escaping should break the intended features of markdown.