mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix loading of external stylesheets in html2epub
This commit is contained in:
parent
501cc90bfa
commit
8f090b2d31
@ -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
|
use the expression "/". See the XPath Tutorial in the calibre User Manual for further
|
||||||
help on using this feature.
|
help on using this feature.
|
||||||
''').replace('\n', ' '))
|
''').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.'))
|
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,
|
structure('cover', ['--cover'], default=None,
|
||||||
help=_('Path to the cover to be used for this book'))
|
help=_('Path to the cover to be used for this book'))
|
||||||
|
@ -540,7 +540,7 @@ class Processor(Parser):
|
|||||||
css = []
|
css = []
|
||||||
for link in self.root.xpath('//link'):
|
for link in self.root.xpath('//link'):
|
||||||
if 'css' in link.get('type', 'text/css').lower():
|
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):
|
if file and os.path.exists(file) and os.path.isfile(file):
|
||||||
css.append(open(file, 'rb').read().decode('utf-8'))
|
css.append(open(file, 'rb').read().decode('utf-8'))
|
||||||
link.getparent().remove(link)
|
link.getparent().remove(link)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user