Simplify the non-CDATA path of tostring.escape.
This commit is contained in:
parent
4b482477e2
commit
15c6b775ff
1 changed files with 1 additions and 4 deletions
|
@ -146,10 +146,7 @@ def escape(text, use_cdata=False):
|
||||||
'"': '"'}
|
'"': '"'}
|
||||||
|
|
||||||
if not use_cdata:
|
if not use_cdata:
|
||||||
text = list(text)
|
return ''.join(escapes.get(c, c) for c in text)
|
||||||
for i, c in enumerate(text):
|
|
||||||
text[i] = escapes.get(c, c)
|
|
||||||
return ''.join(text)
|
|
||||||
else:
|
else:
|
||||||
escape_needed = False
|
escape_needed = False
|
||||||
for c in text:
|
for c in text:
|
||||||
|
|
Loading…
Reference in a new issue