mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-23 19:04:37 +01:00
Fix #845
This commit is contained in:
parent
a59c1a87bc
commit
61c29df9d7
1 changed files with 5 additions and 2 deletions
|
|
@ -176,8 +176,11 @@ def extract_content(self, output_dir=os.getcwdu()):
|
|||
for elem in soup.findAll(['metadata', 'guide']):
|
||||
elem.extract()
|
||||
htmlfile = os.path.join(output_dir, self.name+'.html')
|
||||
for ref in guide.findAll('reference', href=True):
|
||||
ref['href'] = os.path.basename(htmlfile)+ref['href']
|
||||
try:
|
||||
for ref in guide.findAll('reference', href=True):
|
||||
ref['href'] = os.path.basename(htmlfile)+ref['href']
|
||||
except AttributeError:
|
||||
pass
|
||||
open(htmlfile, 'wb').write(unicode(soup).encode('utf8'))
|
||||
self.htmlfile = htmlfile
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue