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

Escape all characters special to markdown. #52

Closed brondsem closed 11 years ago

brondsem commented 11 years ago

These commits will escape all characters that markdown handles specially. As you can see in the test changes, there are a lot of unnecessary escapes (e.g. for periods and hyphens). But the escaping is necessary in some cases. This might be better as an option, if some people prefer prettier output over escaping everything.

aaronsw commented 11 years ago

Yeah, I think this will drive most people up the wall -- it should either escape only when necessary or be an option, default off.

brondsem commented 11 years ago

I've updated my code to make this an option, off by default.

It'd be great if it could do the extra escaping automatically but only when necessary. But I didn't know how to determine when that would be.

brondsem commented 11 years ago

Good point; I've added a commit to revert the changes to the 'normal' test files.