@@ -379,36 +379,32 @@ def closeTagOpenState(self):
379379 # emitting the end tag token.
380380 self .contentModelFlag = contentModelFlags ["PCDATA" ]
381381 else :
382- self .tokenQueue .append ({"type" : "ParseError" , "data" :
383- _ ("Expected closing tag after seeing '</'. None found." )})
384382 self .tokenQueue .append ({"type" : "Characters" , "data" : u"</" })
385383 self .state = self .states ["data" ]
386384
387385 # Need to return here since we don't want the rest of the
388386 # method to be walked through.
389387 return True
390388
391- if self .contentModelFlag == contentModelFlags ["PCDATA" ]:
392- data = self .stream .char ()
393- if data in asciiLetters :
394- self .currentToken = \
395- {"type" : "EndTag" , "name" : data , "data" : []}
396- self .state = self .states ["tagName" ]
397- elif data == u">" :
398- self .tokenQueue .append ({"type" : "ParseError" , "data" :
399- _ ("Expected closing tag. Got '>' instead. Ignoring '</>'." )})
400- self .state = self .states ["data" ]
401- elif data == EOF :
402- self .tokenQueue .append ({"type" : "ParseError" , "data" :
403- _ ("Expected closing tag. Unexpected end of file." )})
404- self .tokenQueue .append ({"type" : "Characters" , "data" : u"</" })
405- self .state = self .states ["data" ]
406- else :
407- # XXX data can be _'_...
408- self .tokenQueue .append ({"type" : "ParseError" , "data" :
409- _ ("Expected closing tag. Unexpected character '" + data + "' found." )})
410- self .stream .queue .append (data )
411- self .state = self .states ["bogusComment" ]
389+ data = self .stream .char ()
390+ if data in asciiLetters :
391+ self .currentToken = {"type" :"EndTag" , "name" :data , "data" :[]}
392+ self .state = self .states ["tagName" ]
393+ elif data == u">" :
394+ self .tokenQueue .append ({"type" : "ParseError" , "data" :
395+ _ ("Expected closing tag. Got '>' instead. Ignoring '</>'." )})
396+ self .state = self .states ["data" ]
397+ elif data == EOF :
398+ self .tokenQueue .append ({"type" : "ParseError" , "data" :
399+ _ ("Expected closing tag. Unexpected end of file." )})
400+ self .tokenQueue .append ({"type" : "Characters" , "data" : u"</" })
401+ self .state = self .states ["data" ]
402+ else :
403+ # XXX data can be _'_...
404+ self .tokenQueue .append ({"type" : "ParseError" , "data" :
405+ _ ("Expected closing tag. Unexpected character '" + data + "' found." )})
406+ self .stream .queue .append (data )
407+ self .state = self .states ["bogusComment" ]
412408 return True
413409
414410 def tagNameState (self ):
0 commit comments