mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-03 20:06:34 +01:00
#1887. Escape characters which are not allowed to appear in attribute values.
This commit is contained in:
parent
f1ba77d172
commit
df4b4707a2
1 changed files with 5 additions and 2 deletions
|
|
@ -276,8 +276,11 @@ def binary_to_text(self, base=0, depth=0):
|
|||
state = 'get attr'
|
||||
elif count > 0:
|
||||
if not in_censorship:
|
||||
self.buf.write(c.encode(
|
||||
'ascii', 'xmlcharrefreplace'))
|
||||
if c == '"':
|
||||
c = '"'
|
||||
elif c == '<':
|
||||
c = '<'
|
||||
self.buf.write(c.encode('ascii', 'xmlcharrefreplace'))
|
||||
count -= 1
|
||||
if count == 0:
|
||||
if not in_censorship:
|
||||
|
|
|
|||
Loading…
Reference in a new issue