8000 IE7-style <h1>-<h6> handling · awesome-python/html5lib-python@33aebe8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 33aebe8

Browse files
committed
IE7-style <h1>-<h6> handling
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40764
1 parent e014816 commit 33aebe8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/html5parser.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -848,14 +848,16 @@ def startTagPlaintext(self, name, attributes):
848848
def startTagHeading(self, name, attributes):
849849
if self.tree.elementInScope("p"):
850850
self.endTagP("p")
851-
for item in headingElements:
852-
if self.tree.elementInScope(item):
853-
self.parser.parseError(_("Unexpected start tag (" + name +\
854-
")."))
855-
item = self.tree.openElements.pop()
856-
while item.name not in headingElements:
857-
item = self.tree.openElements.pop()
858-
break
851+
# Uncomment the following for IE7 behavior:
852+
#
853+
#for item in headingElements:
854+
# if self.tree.elementInScope(item):
855+
# self.parser.parseError(_("Unexpected start tag (" + name +\
856+
# ")."))
857+
# item = self.tree.openElements.pop()
858+
# while item.name not in headingElements:
859+
# item = self.tree.openElements.pop()
860+
# break
859861
self.tree.insertElement(name, attributes)
860862

861863
def startTagA(self, name, attributes):

0 commit comments

Comments
 (0)
0