Skip to content

Commit adfc3fc

Browse files
Merge pull request #587 from Crozzers/fix-assertionerror-issue584
Fix `AssertionError` on malformed HTML (#584)
2 parents c6b69f4 + d593b81 commit adfc3fc

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/markdown2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ def _hash_html_block_sub(
908908
tag = None
909909

910910
if not tag:
911-
m = re.match(r'.*?<(\S).*?>', html)
911+
m = re.match(r'.*?<(\S).*?\s*>', html)
912912
# tag shouldn't be none but make the assertion for type checker
913913
assert m is not None
914914
tag = m.group(1)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
</p
2+
>
3+
<pre>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
</p
2+
>
3+
<pre>

0 commit comments

Comments
 (0)