aaronsw / html2text

Convert HTML to Markdown-formatted text.
http://www.aaronsw.com/2002/html2text/
GNU General Public License v3.0
2.58k stars 410 forks source link

Add semicolon to style data for safety #62

Closed adhiraj closed 11 years ago

adhiraj commented 11 years ago

If the style data does not contain a semicolon, the loop removing @import statements will run infinitely, because the search for ';' returns -1, which with a +1 becomes 0, and appends the data variable to itself. Making sure the data variable has at least one semicolon fixes this problem.

aaronsw commented 11 years ago

Been getting a ton of pull requests lately. Is there some reason everyone is using this now?

aaronsw commented 11 years ago

Can you add a test case for this?