Conversion: Fix an error when using the embed_all_fonts option with certain books

This commit is contained in:
Kovid Goyal 2017-11-22 17:48:24 +05:30
parent e517fbf89f
commit 77a40a22c3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -156,7 +156,7 @@ class EmbedFonts(object):
manifest = self.oeb.manifest
id_, href = manifest.generate('page_css', 'page_styles.css')
self.page_sheet = manifest.add(id_, href, CSS_MIME, data=self.parser.parseString('', validate=False))
head = self.current_item.xpath('//*[local-name()="head"][1]')
head = self.current_item.data.xpath('//*[local-name()="head"][1]')
if head:
href = self.current_item.relhref(href)
l = etree.SubElement(head[0], XHTML('link'),