| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -481,6 +481,7 @@ def beforeAttributeNameState(self): | |||
| 481 | 481 | def attributeNameState(self): | |
| 482 | 482 | data = self.stream.char() | |
| 483 | 483 | leavingThisState = True | |
| 484 | + emitToken = False | ||
| 484 | 485 | if data == u"=": | |
| 485 | 486 | self.state = self.states["beforeAttributeValue"] | |
| 486 | 487 | elif data in asciiLetters: | |
@@ -491,7 +492,7 @@ def attributeNameState(self): | |||
| 491 | 492 | # XXX If we emit here the attributes are converted to a dict | |
| 492 | 493 | # without being checked and when the code below runs we error | |
| 493 | 494 | # because data is a dict not a list | |
| 494 | - pass | ||
| 495 | + emitToken = True | ||
| 495 | 496 | elif data in spaceCharacters: | |
| 496 | 497 | self.state = self.states["afterAttributeName"] | |
| 497 | 498 | elif data == u"/": | |
@@ -500,8 +501,8 @@ def attributeNameState(self): | |||
| 500 | 501 | elif data == EOF: | |
| 501 | 502 | self.tokenQueue.append({"type": "ParseError", "data": | |
| 502 | 503 | _("Unexpected end of file in attribute name.")}) | |
| 503 | - self.emitCurrentToken() | ||
| 504 | - leavingThisState = False | ||
| 504 | + self.state = self.states["data"] | ||
| 505 | + emitToken = True | ||
| 505 | 506 | else: | |
| 506 | 507 | self.currentToken["data"][-1][0] += data | |
| 507 | 508 | leavingThisState = False | |
@@ -515,7 +516,7 @@ def attributeNameState(self): | |||
| 515 | 516 | self.tokenQueue.append({"type": "ParseError", "data": | |
| 516 | 517 | _("Dropped duplicate attribute on tag.")}) | |
| 517 | 518 | # XXX Fix for above XXX | |
| 518 | - if data == u">": | ||
| 519 | + if emitToken: | ||
| 519 | 520 | self.emitCurrentToken() | |
| 520 | 521 | return True | |
| 521 | 522 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments