Skip to content

Commit 073d792

Browse files
committed
Fix #4: nested, indirect descendant, <button> causes infinite loop.
A couple of elements (button, dialog) were missing from the list of endTagBlock in-body-phase dispatcher. This adds them. See html5lib/html5lib-tests#4 for test.
1 parent 89a3c5a commit 073d792

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

html5lib/html5parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,10 +926,10 @@ def __init__(self, parser, tree):
926926
self.endTagHandler = utils.MethodDispatcher([
927927
("body", self.endTagBody),
928928
("html", self.endTagHtml),
929-
(("address", "article", "aside", "blockquote", "center",
930-
"details", "dir", "div", "dl", "fieldset", "figcaption", "figure",
931-
"footer", "header", "hgroup", "listing", "main", "menu", "nav", "ol",
932-
"pre", "section", "summary", "ul"), self.endTagBlock),
929+
(("address", "article", "aside", "blockquote", "button", "center",
930+
"details", "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure",
931+
"footer", "header", "hgroup", "listing", "main", "menu", "nav", "ol", "pre",
932+
"section", "summary", "ul"), self.endTagBlock),
933933
("form", self.endTagForm),
934934
("p", self.endTagP),
935935
(("dd", "dt", "li"), self.endTagListItem),

0 commit comments

Comments
 (0)