Skip to content

Commit 8dce86d

Browse files
committed
fix some testcases to reveal more bugs (while fixing some) and add a note in the after body phase
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40486
1 parent 541e84e commit 8dce86d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/html5parser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ def processEOF(self):
236236
elif len(self.tree.openElements) == 2 and\
237237
self.tree.openElements[1].name != "body":
238238
# This happens for framesets or something?
239-
self.parser.parseError(_("XXXXX FRAMESET?"))
239+
self.parser.parseError(_("Unexpected end of file. Expected end "
240+
u"tag (" + self.tree.openElements[1].name + u") first."))
240241
elif self.parser.innerHTML and len(self.tree.openElements) > 1 :
241242
# XXX This is not what the specification says. Not sure what to do
242243
# here.
@@ -1651,6 +1652,10 @@ def endTagHtml(self,name):
16511652
if self.parser.innerHTML:
16521653
self.parser.parseError()
16531654
else:
1655+
# XXX: This may need to be done, not sure:
1656+
# Don't set lastPhase to the current phase but to the inBody phase
1657+
# instead. No need for extra parse errors if there's something
1658+
# after </html>.
16541659
self.parser.lastPhase = self.parser.phase
16551660
self.parser.phase = self.parser.phases["trailingEnd"]
16561661

0 commit comments

Comments
 (0)