aaronsw / html2text

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

foo<br>bar inserts a blank line #12

Closed benw closed 11 years ago

benw commented 13 years ago

Input:

foo<br>bar

Current output:

foo

bar

Preferred output:

foo<sp><sp>
bar

i.e. append two spaces to foo, to keep the same formatting as the <br>.

aaronsw commented 13 years ago

Seems to be caused by optwrap. textwrap.wrap tosses the trailing spaces and then optwrap breaks the line up into paragraphs.