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:
|
||||
text = list(text)
|
||||
for i, c in enumerate(text):
|
||||
text[i] = escapes.get(c, c)
|
||||
return ''.join(text)
|
||||
return ''.join(escapes.get(c, c) for c in text)
|
||||
else:
|
||||
escape_needed = False
|
||||
for c in text:
|
||||
|
|
Loading…
Reference in a new issue