diff --git a/CHANGES.md b/CHANGES.md index 707592c2..839d1a14 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ ## python-markdown2 2.5.6 (not yet released) -(nothing yet) +- [pull #687] Fix AssertionError hashing HTML blocks spread over multiple lines (#686) ## python-markdown2 2.5.5 diff --git a/lib/markdown2.py b/lib/markdown2.py index b831896f..14ae415c 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -922,7 +922,7 @@ def _hash_html_block_sub( tag = None if not tag: - m = re.match(r'.*?<(\S).*?\s*>', html) + m = re.match(r'.*?<(\S).*?\s*>', html, re.S) # tag shouldn't be none but make the assertion for type checker assert m is not None tag = m.group(1) diff --git a/test/tm-cases/hash_html_blocks_issue686.html b/test/tm-cases/hash_html_blocks_issue686.html new file mode 100644 index 00000000..a6398989 --- /dev/null +++ b/test/tm-cases/hash_html_blocks_issue686.html @@ -0,0 +1,3 @@ +

test +

diff --git a/test/tm-cases/hash_html_blocks_issue686.tags b/test/tm-cases/hash_html_blocks_issue686.tags new file mode 100644 index 00000000..7bd1a023 --- /dev/null +++ b/test/tm-cases/hash_html_blocks_issue686.tags @@ -0,0 +1 @@ +issue686 assertionerror \ No newline at end of file diff --git a/test/tm-cases/hash_html_blocks_issue686.text b/test/tm-cases/hash_html_blocks_issue686.text new file mode 100644 index 00000000..a6398989 --- /dev/null +++ b/test/tm-cases/hash_html_blocks_issue686.text @@ -0,0 +1,3 @@ +

test +