From 8f090b2d319ce05537bf0d6ad7c8a9e0dc4135d9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 23 Sep 2008 13:33:53 -0700 Subject: [PATCH] Fix loading of external stylesheets in html2epub --- src/calibre/ebooks/epub/__init__.py | 2 +- src/calibre/ebooks/html.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/epub/__init__.py b/src/calibre/ebooks/epub/__init__.py index 487202be87..f003df5ec2 100644 --- a/src/calibre/ebooks/epub/__init__.py +++ b/src/calibre/ebooks/epub/__init__.py @@ -71,7 +71,7 @@ The expression used must evaluate to a list of elements. To disable chapter dete use the expression "/". See the XPath Tutorial in the calibre User Manual for further help on using this feature. ''').replace('\n', ' ')) - structure('chapter_mark', ['--chapter-mark'], choices=['pagebreak', 'rule', 'both'], + structure('chapter_mark', ['--chapter-mark'], choices=['pagebreak', 'rule', 'both', 'none'], default='pagebreak', help=_('Specify how to mark detected chapters. A value of "pagebreak" will insert page breaks before chapters. A value of "rule" will insert a line before chapters. A value of "none" will disable chapter marking and a value of "both" will use both page breaks and lines to mark chapters.')) structure('cover', ['--cover'], default=None, help=_('Path to the cover to be used for this book')) diff --git a/src/calibre/ebooks/html.py b/src/calibre/ebooks/html.py index 20d0546fd0..713322e8c7 100644 --- a/src/calibre/ebooks/html.py +++ b/src/calibre/ebooks/html.py @@ -540,7 +540,7 @@ class Processor(Parser): css = [] for link in self.root.xpath('//link'): if 'css' in link.get('type', 'text/css').lower(): - file = self.htmlfile.resolve(unicode(link.get('href', ''), self.htmlfile.encoding)).path + file = os.path.join(self.tdir, link.get('href', '')) if file and os.path.exists(file) and os.path.isfile(file): css.append(open(file, 'rb').read().decode('utf-8')) link.getparent().remove(link)