File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -481,6 +481,7 @@ def beforeAttributeNameState(self):
481481 def attributeNameState (self ):
482482 data = self .stream .char ()
483483 leavingThisState = True
484+ emitToken = False
484485 if data == u"=" :
485486 self .state = self .states ["beforeAttributeValue" ]
486487 elif data in asciiLetters :
@@ -491,7 +492,7 @@ def attributeNameState(self):
491492 # XXX If we emit here the attributes are converted to a dict
492493 # without being checked and when the code below runs we error
493494 # because data is a dict not a list
494- pass
495+ emitToken = True
495496 elif data in spaceCharacters :
496497 self .state = self .states ["afterAttributeName" ]
497498 elif data == u"/" :
@@ -500,8 +501,8 @@ def attributeNameState(self):
500501 elif data == EOF :
501502 self .tokenQueue .append ({"type" : "ParseError" , "data" :
502503 _ ("Unexpected end of file in attribute name." )})
503- self .emitCurrentToken ()
504- leavingThisState = False
504+ self .state = self . states [ "data" ]
505+ emitToken = True
505506 else :
506507 self .currentToken ["data" ][- 1 ][0 ] += data
507508 leavingThisState = False
@@ -515,7 +516,7 @@ def attributeNameState(self):
515516 self .tokenQueue .append ({"type" : "ParseError" , "data" :
516517 _ ("Dropped duplicate attribute on tag." )})
517518 # XXX Fix for above XXX
518- if data == u">" :
519+ if emitToken :
519520 self .emitCurrentToken ()
520521 return True
521522
You can’t perform that action at this time.
0 commit comments