8000 implement new <nobr> handling and add testcases for <nobr> · html5lib/html5lib-python@4e4c2a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e4c2a4

Browse files
committed
implement new <nobr> handling and add testcases for <nobr>
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40778
1 parent 954f2a9 commit 4e4c2a4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/html5parser.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,9 @@ def __init__(self, parser, tree):
704704
("plaintext",self.startTagPlaintext),
705705
(headingElements, self.startTagHeading),
706706
("a", self.startTagA),
707-
(("b", "big", "em", "font", "i", "nobr", "s", "small", "strike",
708-
"strong", "tt", "u"),self.startTagFormatting),
707+
(("b", "big", "em", "font", "i", "s", "small", "strike", "strong",
708+
"tt", "u"),self.startTagFormatting),
709+
("nobr", self.startTagNobr),
709710
("button", self.startTagButton),
710711
(("marquee", "object"), self.startTagMarqueeObject),
711712
("xmp", self.startTagXmp),
@@ -877,6 +878,12 @@ def startTagFormatting(self, name, attributes):
877878
self.tree.reconstructActiveFormattingElements()
878879
self.addFormattingElement(name, attributes)
879880

881+
def startTagNobr(self, name, attributes):
882+
self.tree.reconstructActiveFormattingElements()
883+
if self.tree.elementInScope("nobr"):
884+
self.processEndTag("nobr")
885+
self.addFormattingElement(name, attributes)
886+
880887
def startTagButton(self, name, attributes):
881888
if self.tree.elementInScope("button"):
882889
self.parser.parseError(_("Unexpected start tag (button) implied "

0 commit comments

Comments
 (0)
0