Skip to content

Commit 82e83af

Browse files
authored
Update test_html_rewriter to match Python HtmlParser's new behavior (#970)
In Python 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6 and 3.14.0 HtmlParser was changed as a security update to more correctly follow the HTML5 standard. This changed the output of one of our tests. The output change doesn't appear to have a meaningful impact in this case as browsers treat it as a comment either way, so this just updates the test to match the output of the latest Python versions. Fixes #969
1 parent b43963c commit 82e83af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pywb/rewrite/test/test_html_rewriter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,10 @@
413413
<!--[if !IE]><html><![endif]--><a href="/web/20131226101010/http://example.com/"><!--[if IE]><![endif]--><a href="/web/20131226101010/http://example.com/"></html>
414414
415415
# IE conditional with invalid ']-->' ending, rewritten as ']>'
416+
# Note: HtmlParser was changed in Python 3.9.24, 3.10.19, 3.11.14, 3.12.12, 3.13.6, 3.14.0.
417+
# The output of this test will differ on older Python versions.
416418
>>> parse('<!--[if !IE]> --><html><![endif]--><a href="http://example.com/"><!--[if IE]><![endif]--><a href="http://example.com/"></html>')
417-
<!--[if !IE]> --><html><![endif]><a href="/web/20131226101010/http://example.com/"><!--[if IE]><![endif]--><a href="/web/20131226101010/http://example.com/"></html>
419+
<!--[if !IE]> --><html><!--[endif]----><a href="/web/20131226101010/http://example.com/"><!--[if IE]><![endif]--><a href="/web/20131226101010/http://example.com/"></html>
418420
419421
# Test tag with a target
420422
>>> parse('<HTML><A Href=\"page.html\" target=\"_blank\">Text</a></hTmL>')

0 commit comments

Comments
 (0)