Skip to content

Commit 4cb16fa

Browse files
committed
Added test for "--x>" not resetting the escape flag. Updated Python code to pass.
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401132
1 parent 10ce700 commit 4cb16fa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/html5lib/tokenizer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,14 @@ def dataState(self):
333333
# emitted separately.
334334
self.tokenQueue.append({"type": "SpaceCharacters", "data":
335335
data + self.stream.charsUntil(spaceCharacters, True)})
336+
# No need to update lastFourChars here, since the first space will
337+
# have already broken any <!-- or --> sequences
336338
else:
339+
chars = self.stream.charsUntil(("&", "<", ">", "-"))
337340
self.tokenQueue.append({"type": "Characters", "data":
338-
data + self.stream.charsUntil(("&", "<", ">", "-"))})
341+
data + chars})
342+
self.lastFourChars += chars[-4:]
343+
self.lastFourChars = self.lastFourChars[-4:]
339344
return True
340345

341346
def entityDataState(self):

0 commit comments

Comments
 (0)