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

Fix handling of empty stripped para in skipwrap #39

Closed blueyed closed 12 years ago

blueyed commented 12 years ago

e522f85c refactored handling of paragraphs, but now can crash with IndexError, if the stripped string is empty.

This patch fixes this by using slice indices.

blueyed commented 12 years ago

Wow.. that was fast.. I just noticed that a test (emdash-para) is failing now and wanted to remove this pull request.

Maybe only the tests need to be adjusted though.. I assume you will take a look at this?

aaronsw commented 12 years ago

Oh, I assumed you ran the tests.

aaronsw commented 12 years ago

They all pass for me...are you sure it's not a different change?

emdash-para.html (module): PASS
emdash-para.html (script): PASS
blueyed commented 12 years ago

The test fails with 2e05d75, too. So it's at least not my change.

It looks like the "-b0" is not used for emdash-para.md, but with output.md.