@@ -231,8 +231,8 @@ def __init__(self, parser, tree):
231
231
def processEOF (self ):
232
232
self .tree .generateImpliedEndTags ()
233
233
if len (self .tree .openElements ) > 2 :
234
- self .parser .parseError (_ ("Unexpected end of file. Missing closing "
235
- " tags" ))
234
+ self .parser .parseError (_ ("Unexpected end of file. "
235
+ u"Missing closing tags. " ))
236
236
elif len (self .tree .openElements ) == 2 and \
237
237
self .tree .openElements [1 ].name != "body" :
238
238
# This happens for framesets or something?
@@ -418,6 +418,8 @@ def appendToHead(self, element):
418
418
# the real thing
419
419
def processEOF (self ):
420
420
if self .tree .openElements [- 1 ].name in ("title" , "style" , "script" ):
421
+ self .parser .parseError (_ (u"Unexpected end of file. "
422
+ u"Expected end tag (" + self .tree .openElements [- 1 ].name + ")." ))
421
423
self .tree .openElements .pop ()
422
424
self .anythingElse ()
423
425
self .parser .phase .processEOF ()
@@ -700,8 +702,8 @@ def startTagHeading(self, name, attributes):
700
702
def startTagA (self , name , attributes ):
701
703
afeAElement = self .tree .elementInActiveFormattingElements ("a" )
702
704
if afeAElement :
703
- self .parser .parseError (_ (u"Start tag a was in the list of active "
704
- "formatting elements ." ))
705
+ self .parser .parseError (_ (u"Unexpected start tag (a) implies "
706
+ "end tag (a) ." ))
705
707
self .endTagFormatting ("a" )
706
708
if afeAElement in self .tree .openElements :
707
709
self .tree .openElements .remove (afeAElement )
0 commit comments