Skip to content

Commit

Permalink
Handle nulls correctly in table text
Browse files Browse the repository at this point in the history
--HG--
extra : transplant_source : %F2%88%7C%C3%E7%FE%07%9C5NhYaq%9F%B9%E8%9B%B9%F8
  • Loading branch information
James Graham committed Jul 24, 2011
1 parent 1acc7e7 commit 9cd98fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions html5lib/html5parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,13 +1664,13 @@ def processSpaceCharacters(self, token):
originalPhase = self.parser.phase
self.parser.phase = self.parser.phases["inTableText"]
self.parser.phase.originalPhase = originalPhase
self.parser.phase.characterTokens.append(token)
self.parser.phase.processSpaceCharacters(token)

def processCharacters(self, token):
originalPhase = self.parser.phase
self.parser.phase = self.parser.phases["inTableText"]
self.parser.phase.originalPhase = originalPhase
self.parser.phase.characterTokens.append(token)
self.parser.phase.processCharacters(token)

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

def processCharacters(self, token):
if token["data"] == u"\u0000":
return
self.characterTokens.append(token)

def processSpaceCharacters(self, token):
Expand Down

0 comments on commit 9cd98fc

Please sign in to comment.