Skip to content

Commit

Permalink
Add failing test for parsing invalid HTML with standard library `html…
Browse files Browse the repository at this point in the history
….parser`

Seen in the wild.
  • Loading branch information
charmander committed May 14, 2024
1 parent ef5aac4 commit 19a6150
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libweasyl/test/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def test_html_to_text():
assert html.html_to_text("ì") == "ì", "`html_to_text` should decode numeric character references"
assert html.html_to_text('foo <img alt="bar"> baz') == "foo [bar] baz", "`html_to_text` should replace images with their alt text"
assert html.html_to_text(" foo\nbar baz\t") == "foo bar baz", "`html_to_text` should normalize whitespace"
assert html.html_to_text("a<![/b]>c") == "ac", "`html_to_text` shouldn’t throw on invalid HTML"


def test_inline_json():
Expand Down

0 comments on commit 19a6150

Please sign in to comment.