mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Sjoerd patches the previous patch:
In literal mode, also don't do anything about entity and character references, or about closing CDATA elements.
This commit is contained in:
parent
f0f3600d0b
commit
204b65c50f
1 changed files with 10 additions and 0 deletions
|
@ -264,6 +264,11 @@ class XMLParser:
|
|||
i = k
|
||||
continue
|
||||
elif rawdata[i] == '&':
|
||||
if self.literal:
|
||||
data = rawdata[i]
|
||||
self.handle_data(data)
|
||||
i = i+1
|
||||
continue
|
||||
res = charref.match(rawdata, i)
|
||||
if res is not None:
|
||||
i = res.end(0)
|
||||
|
@ -292,6 +297,11 @@ class XMLParser:
|
|||
self.lineno = self.lineno + string.count(res.group(0), '\n')
|
||||
continue
|
||||
elif rawdata[i] == ']':
|
||||
if self.literal:
|
||||
data = rawdata[i]
|
||||
self.handle_data(data)
|
||||
i = i+1
|
||||
continue
|
||||
if n-i < 3:
|
||||
break
|
||||
if cdataclose.match(rawdata, i):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue