This commit is contained in:
Kovid Goyal 2007-10-09 23:34:25 +00:00
parent d4b540b8cf
commit 9eee4a67b6
2 changed files with 4 additions and 3 deletions

View File

@ -292,7 +292,7 @@ def Book(options, logger, font_delta=0, header=None,
raise ConversionError, 'Could not find the normal version of the ' + family + ' font' raise ConversionError, 'Could not find the normal version of the ' + family + ' font'
return book, fonts return book, fonts
def entity_to_unicode(self, match): def entity_to_unicode(match):
ent = match.group(1) ent = match.group(1)
if ent.startswith(u'#x'): if ent.startswith(u'#x'):
return unichr(int(ent[2:], 16)) return unichr(int(ent[2:], 16))

View File

@ -51,11 +51,12 @@ class OPFReader(MetaInformation):
if not role: if not role:
role = elem.get('opf:role') role = elem.get('opf:role')
if role == 'aut': if role == 'aut':
au = elem.string.split(',') raw = self.ENTITY_PATTERN.sub(entity_to_unicode, elem.string)
au = raw.split(',')
ans = [] ans = []
for i in au: for i in au:
ans.extend(i.split('&')) ans.extend(i.split('&'))
return self.ENTITY_PATTERN.sub(entity_to_unicode, ans) return ans
return None return None
return property(doc=doc, fget=fget) return property(doc=doc, fget=fget)