From e00d7c61c2770c08d16d7f1fd293fae605277491 Mon Sep 17 00:00:00 2001 From: James Addison Date: Thu, 31 Dec 2020 13:22:17 +0000 Subject: [PATCH 1/2] Remove failing test from pytest.expect --- .pytest.expect | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.pytest.expect b/.pytest.expect index 22cf51bb..5a9c3d75 100644 --- a/.pytest.expect +++ b/.pytest.expect @@ -1289,14 +1289,6 @@ u'html5lib/tests/testdata/tree-construction/tests25.dat::7::cElementTree::parser u'html5lib/tests/testdata/tree-construction/tests25.dat::7::cElementTree::parser::void-namespace': FAIL u'html5lib/tests/testdata/tree-construction/tests25.dat::7::lxml::parser::namespaced': FAIL u'html5lib/tests/testdata/tree-construction/tests25.dat::7::lxml::parser::void-namespace': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::DOM::parser::namespaced': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::DOM::parser::void-namespace': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::ElementTree::parser::namespaced': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::ElementTree::parser::void-namespace': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::cElementTree::parser::namespaced': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::cElementTree::parser::void-namespace': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::lxml::parser::namespaced': FAIL -u'html5lib/tests/testdata/tree-construction/tests8.dat::5::lxml::parser::void-namespace': FAIL u'html5lib/tests/testdata/tree-construction/webkit02.dat::14::DOM::parser::namespaced': FAIL u'html5lib/tests/testdata/tree-construction/webkit02.dat::14::DOM::parser::void-namespace': FAIL u'html5lib/tests/testdata/tree-construction/webkit02.dat::14::ElementTree::parser::namespaced': FAIL From ca34912f4c56a15ed07463cfb86a6cbf54b83372 Mon Sep 17 00:00:00 2001 From: James Addison Date: Thu, 31 Dec 2020 15:29:30 +0000 Subject: [PATCH 2/2] Tree Construction: do not use phase-specific handling of implied end-tag tokens --- html5lib/html5parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html5lib/html5parser.py b/html5lib/html5parser.py index 74d829d9..3ccd8561 100644 --- a/html5lib/html5parser.py +++ b/html5lib/html5parser.py @@ -1068,7 +1068,7 @@ def startTagListItem(self, token): stopNames = stopNamesMap[token["name"]] for node in reversed(self.tree.openElements): if node.name in stopNames: - self.parser.phase.processEndTag( + self.parser.phases["inBody"].processEndTag( impliedTagToken(node.name, "EndTag")) break if (node.nameTuple in specialElements and @@ -1076,7 +1076,7 @@ def startTagListItem(self, token): break if self.tree.elementInScope("p", variant="button"): - self.parser.phase.processEndTag( + self.parser.phases["inBody"].processEndTag( impliedTagToken("p", "EndTag")) self.tree.insertElement(token)