thephpleague / html-to-markdown

Convert HTML to Markdown with PHP
MIT License
1.77k stars 205 forks source link

Fix sanitization bug (#63) #101

Closed andreskrey closed 8 years ago

andreskrey commented 8 years ago

This PR will fix issue #63 Please notice that the code example in the issue is malformed. The head and body tags on it aren't escaped and all tags inside code tags must be escaped.

Using this snippet returns the correct markdown:

<pre><code>... &lt;script type = "text/javascript"&gt; function startTimer() { var tim = window.setTimeout("hideMessage()", 5000) } &lt;/head&gt; &lt;body&gt; ...</code></pre>

colinodell commented 8 years ago

Thanks for providing this fix!