mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #845
This commit is contained in:
parent
a59c1a87bc
commit
61c29df9d7
@ -176,8 +176,11 @@ class MobiReader(object):
|
|||||||
for elem in soup.findAll(['metadata', 'guide']):
|
for elem in soup.findAll(['metadata', 'guide']):
|
||||||
elem.extract()
|
elem.extract()
|
||||||
htmlfile = os.path.join(output_dir, self.name+'.html')
|
htmlfile = os.path.join(output_dir, self.name+'.html')
|
||||||
|
try:
|
||||||
for ref in guide.findAll('reference', href=True):
|
for ref in guide.findAll('reference', href=True):
|
||||||
ref['href'] = os.path.basename(htmlfile)+ref['href']
|
ref['href'] = os.path.basename(htmlfile)+ref['href']
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
open(htmlfile, 'wb').write(unicode(soup).encode('utf8'))
|
open(htmlfile, 'wb').write(unicode(soup).encode('utf8'))
|
||||||
self.htmlfile = htmlfile
|
self.htmlfile = htmlfile
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user