Skip to content

Tree Construction: do not use phase-specific handling for implied end-tag tokens emitted during InBody phase #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .pytest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -1321,14 +1321,6 @@ u'html5lib/tests/testdata/tree-construction/tests26.dat::19::cElementTree::parse
u'html5lib/tests/testdata/tree-construction/tests26.dat::19::cElementTree::parser::void-namespace': FAIL
u'html5lib/tests/testdata/tree-construction/tests26.dat::19::lxml::parser::namespaced': FAIL
u'html5lib/tests/testdata/tree-construction/tests26.dat::19::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
Expand Down
4 changes: 2 additions & 2 deletions html5lib/html5parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,15 +1068,15 @@ 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
node.name not in ("address", "div", "p")):
break

if self.tree.elementInScope("p", variant="button"):
self.parser.phase.processEndTag(
self.parser.phases["inBody"].processEndTag(
impliedTagToken("p", "EndTag"))

self.tree.insertElement(token)
Expand Down