Skip to content

Commit f06451e

Browse files
committed
Add assert for leavingThisState
1 parent 4822712 commit f06451e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

html5lib/_tokenizer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ def attributeNameState(self):
936936
self.currentToken["data"][-1][0] += data
937937
leavingThisState = False
938938

939+
assert leavingThisState == ((self._state != self.attributeNameState) or emitToken)
939940
if leavingThisState:
940941
# Attributes are not dropped at this stage. That happens when the
941942
# start tag token is emitted so values can still be safely appended

0 commit comments

Comments
 (0)