trentm / python-markdown2

markdown2: A fast and complete implementation of Markdown in Python
Other
2.66k stars 433 forks source link

Fix `AssertionError` on malformed HTML (#584) #587

Closed Crozzers closed 4 months ago

Crozzers commented 4 months ago

This PR fixes #584 by performing better matching of malformed HTML in _hash_html_block_sub.

The issue occurred when the closing angle bracket was on a newline compared to the rest of the tag. I fixed this by tweaking the regex to allow whitespace and newlines between the main body of the tag and the closing bracket

nicholasserra commented 4 months ago

Thank you!