MOBI Output:Fix bug that cause MOBI conversion to sometimes fail when linking to an external stylesheet

This commit is contained in:
Kovid Goyal 2009-04-21 14:10:00 -07:00
parent 8dd974ff42
commit 241a2fc099
2 changed files with 130 additions and 131 deletions

View File

@ -606,7 +606,7 @@ class Processor(Parser):
elem.addprevious(mark)
def save(self, strip_comments=False):
style_path = os.path.splitext(os.path.basename(self.save_path()))[0]
style_path = os.path.splitext(os.path.basename(self.save_path()))[0]+'_calibre'
for i, sheet in enumerate([self.stylesheet, self.font_css, self.override_css]):
if sheet is not None:
style = etree.SubElement(self.head, 'link', attrib={'type':'text/css', 'rel':'stylesheet',
@ -826,7 +826,6 @@ class Processor(Parser):
if parsed_sheets.has_key(file):
self.external_stylesheets.append(parsed_sheets[file])
for style in self.root.xpath('//style'):
if 'css' in style.get('type', 'text/css').lower():
override_css = style.get('title', '') == 'override_css'