Use fully correct quoting on Mobi //guide/reference attributes.

This commit is contained in:
Marshall T. Vandegrift 2009-01-16 19:24:07 -05:00
parent 0c3239c90d
commit e8f7219108
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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()