mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-27 15:25:44 +01:00
IGN:...
This commit is contained in:
parent
bdd9e1c027
commit
b562646c8d
1 changed files with 9 additions and 0 deletions
|
|
@ -59,6 +59,11 @@ def parse_html(self):
|
|||
self.detected_chapters = self.opts.chapter(self.root)
|
||||
|
||||
def rewrite_links(self, olink):
|
||||
'''
|
||||
Make all links in document relative so that they work in the EPUB container.
|
||||
Also copies any resources (like image, stylesheets, scripts, etc.) into
|
||||
the local tree.
|
||||
'''
|
||||
link = self.htmlfile.resolve(olink)
|
||||
if not link.path or not os.path.exists(link.path) or not os.path.isfile(link.path):
|
||||
return olink
|
||||
|
|
@ -76,6 +81,10 @@ def rewrite_links(self, olink):
|
|||
|
||||
|
||||
def extract_css(self):
|
||||
'''
|
||||
Remove all CSS information from the document and store in self.raw_css.
|
||||
This includes <font> tags.
|
||||
'''
|
||||
css = []
|
||||
for link in self.root.xpath('//link'):
|
||||
if 'css' in link.get('type', 'text/css').lower():
|
||||
|
|
|
|||
Loading…
Reference in a new issue