Skip to content

Commit 9cd98fc

Browse files
author
James Graham
committed
Handle nulls correctly in table text
--HG-- extra : transplant_source : %F2%88%7C%C3%E7%FE%07%9C5NhYaq%9F%B9%E8%9B%B9%F8
1 parent 1acc7e7 commit 9cd98fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

html5lib/html5parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,13 +1664,13 @@ def processSpaceCharacters(self, token):
16641664
originalPhase = self.parser.phase
16651665
self.parser.phase = self.parser.phases["inTableText"]
16661666
self.parser.phase.originalPhase = originalPhase
1667-
self.parser.phase.characterTokens.append(token)
1667+
self.parser.phase.processSpaceCharacters(token)
16681668

16691669
def processCharacters(self, token):
16701670
originalPhase = self.parser.phase
16711671
self.parser.phase = self.parser.phases["inTableText"]
16721672
self.parser.phase.originalPhase = originalPhase
1673-
self.parser.phase.characterTokens.append(token)
1673+
self.parser.phase.processCharacters(token)
16741674

16751675
def insertText(self, token):
16761676
#If we get here there must be at least one non-whitespace character
@@ -1789,6 +1789,8 @@ def processEOF(self):
17891789
return True
17901790

17911791
def processCharacters(self, token):
1792+
if token["data"] == u"\u0000":
1793+
return
17921794
self.characterTokens.append(token)
17931795

17941796
def processSpaceCharacters(self, token):

0 commit comments

Comments
 (0)