mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
#1887. Escape characters which are not allowed to appear in attribute values.
This commit is contained in:
parent
f1ba77d172
commit
df4b4707a2
@ -276,8 +276,11 @@ class UnBinary(object):
|
|||||||
state = 'get attr'
|
state = 'get attr'
|
||||||
elif count > 0:
|
elif count > 0:
|
||||||
if not in_censorship:
|
if not in_censorship:
|
||||||
self.buf.write(c.encode(
|
if c == '"':
|
||||||
'ascii', 'xmlcharrefreplace'))
|
c = '"'
|
||||||
|
elif c == '<':
|
||||||
|
c = '<'
|
||||||
|
self.buf.write(c.encode('ascii', 'xmlcharrefreplace'))
|
||||||
count -= 1
|
count -= 1
|
||||||
if count == 0:
|
if count == 0:
|
||||||
if not in_censorship:
|
if not in_censorship:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user