mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:...
This commit is contained in:
parent
bdd9e1c027
commit
b562646c8d
@ -59,6 +59,11 @@ class HTMLProcessor(PreProcessor, LoggingInterface):
|
|||||||
self.detected_chapters = self.opts.chapter(self.root)
|
self.detected_chapters = self.opts.chapter(self.root)
|
||||||
|
|
||||||
def rewrite_links(self, olink):
|
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)
|
link = self.htmlfile.resolve(olink)
|
||||||
if not link.path or not os.path.exists(link.path) or not os.path.isfile(link.path):
|
if not link.path or not os.path.exists(link.path) or not os.path.isfile(link.path):
|
||||||
return olink
|
return olink
|
||||||
@ -76,6 +81,10 @@ class HTMLProcessor(PreProcessor, LoggingInterface):
|
|||||||
|
|
||||||
|
|
||||||
def extract_css(self):
|
def extract_css(self):
|
||||||
|
'''
|
||||||
|
Remove all CSS information from the document and store in self.raw_css.
|
||||||
|
This includes <font> tags.
|
||||||
|
'''
|
||||||
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():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user