10000 Fix some of Phillip's new testcases · awesome-python/html5lib-python@16c86c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16c86c2

Browse files
committed
Fix some of Phillip's new testcases
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40888
1 parent 7476b19 commit 16c86c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/html5lib/inputstream.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ def char(self):
220220
'replaced with U+FFFD')
221221
c = u'\uFFFD'
222222
if c == '\r':
223-
c = self.dataStream.read(1, 1)
224-
if c != '\n':
223+
#XXX This isn't right in the case with multiple CR in a row
224+
#also recursing here isn't ideal + not sure what happens to input position
225+
c = self.char()
226+
if c and c != '\n':
225227
self.queue.insert(0, unicode(c))
226228
c = '\n'
227229

0 commit comments

Comments
 (0)
0