mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Use fully correct quoting on Mobi //guide/reference attributes.
This commit is contained in:
parent
0c3239c90d
commit
e8f7219108
@ -120,11 +120,11 @@ class Serializer(object):
|
|||||||
if hrefs[path].media_type not in OEB_DOCS:
|
if hrefs[path].media_type not in OEB_DOCS:
|
||||||
continue
|
continue
|
||||||
buffer.write('<reference type="')
|
buffer.write('<reference type="')
|
||||||
self.serialize_text(ref.type)
|
self.serialize_text(ref.type, quot=True)
|
||||||
buffer.write('" ')
|
buffer.write('" ')
|
||||||
if ref.title is not None:
|
if ref.title is not None:
|
||||||
buffer.write('title="')
|
buffer.write('title="')
|
||||||
self.serialize_text(ref.title)
|
self.serialize_text(ref.title, quot=True)
|
||||||
buffer.write('" ')
|
buffer.write('" ')
|
||||||
self.serialize_href(ref.href)
|
self.serialize_href(ref.href)
|
||||||
# Space required or won't work, I kid you not
|
# Space required or won't work, I kid you not
|
||||||
|
@ -551,7 +551,7 @@ class Guide(object):
|
|||||||
TYPES = set(t for t, _ in _TYPES_TITLES)
|
TYPES = set(t for t, _ in _TYPES_TITLES)
|
||||||
TITLES = dict(_TYPES_TITLES)
|
TITLES = dict(_TYPES_TITLES)
|
||||||
ORDER = dict((t, i) for (t, _), i in izip(_TYPES_TITLES, count(0)))
|
ORDER = dict((t, i) for (t, _), i in izip(_TYPES_TITLES, count(0)))
|
||||||
|
|
||||||
def __init__(self, type, title, href):
|
def __init__(self, type, title, href):
|
||||||
if type.lower() in self.TYPES:
|
if type.lower() in self.TYPES:
|
||||||
type = type.lower()
|
type = type.lower()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user