Skip to content

Commit 204b65c

Browse files
committed
Sjoerd patches the previous patch:
In literal mode, also don't do anything about entity and character references, or about closing CDATA elements.
1 parent f0f3600 commit 204b65c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/xmllib.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ def goahead(self, end):
264264
i = k
265265
continue
266266
elif rawdata[i] == '&':
267+
if self.literal:
268+
data = rawdata[i]
269+
self.handle_data(data)
270+
i = i+1
271+
continue
267272
res = charref.match(rawdata, i)
268273
if res is not None:
269274
i = res.end(0)
@@ -292,6 +297,11 @@ def goahead(self, end):
292297
self.lineno = self.lineno + string.count(res.group(0), '\n')
293298
continue
294299
elif rawdata[i] == ']':
300+
if self.literal:
301+
data = rawdata[i]
302+
self.handle_data(data)
303+
i = i+1
304+
continue
295305
if n-i < 3:
296306
break
297307
if cdataclose.match(rawdata, i):

0 commit comments

Comments
 (0)