mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #247
This commit is contained in:
parent
8238c34879
commit
513a7e9b4b
@ -236,7 +236,16 @@ class HTMLConverter(object):
|
|||||||
self.base_files = copy.copy(paths)
|
self.base_files = copy.copy(paths)
|
||||||
while len(paths) > 0 and self.link_level <= self.link_levels:
|
while len(paths) > 0 and self.link_level <= self.link_levels:
|
||||||
for path in paths:
|
for path in paths:
|
||||||
self.add_file(path)
|
try:
|
||||||
|
self.add_file(path)
|
||||||
|
except:
|
||||||
|
for link in self.links:
|
||||||
|
if link['path'] == path:
|
||||||
|
self.links.remove(link)
|
||||||
|
break
|
||||||
|
self.logger.warn('Could not process '+path)
|
||||||
|
if self.verbose:
|
||||||
|
self.logger.exception(' ')
|
||||||
self.links = self.process_links()
|
self.links = self.process_links()
|
||||||
self.link_level += 1
|
self.link_level += 1
|
||||||
paths = [link['path'] for link in self.links]
|
paths = [link['path'] for link in self.links]
|
||||||
@ -554,6 +563,7 @@ class HTMLConverter(object):
|
|||||||
tb = self.tops[path]
|
tb = self.tops[path]
|
||||||
if self.link_level == 0 and self.use_spine:
|
if self.link_level == 0 and self.use_spine:
|
||||||
add_toc_entry(ascii_text, tb)
|
add_toc_entry(ascii_text, tb)
|
||||||
|
|
||||||
jb = JumpButton(tb)
|
jb = JumpButton(tb)
|
||||||
self.book.append(jb)
|
self.book.append(jb)
|
||||||
cb = CharButton(jb, text=text)
|
cb = CharButton(jb, text=text)
|
||||||
@ -1258,6 +1268,7 @@ class HTMLConverter(object):
|
|||||||
if tag.has_key('id') or tag.has_key('name'):
|
if tag.has_key('id') or tag.has_key('name'):
|
||||||
key = 'name' if tag.has_key('name') else 'id'
|
key = 'name' if tag.has_key('name') else 'id'
|
||||||
self.targets[self.target_prefix+tag[key]] = self.current_block
|
self.targets[self.target_prefix+tag[key]] = self.current_block
|
||||||
|
self.current_block.must_append = True
|
||||||
elif not urlparse(tag['href'])[0]:
|
elif not urlparse(tag['href'])[0]:
|
||||||
self.logger.warn('Could not follow link to '+tag['href'])
|
self.logger.warn('Could not follow link to '+tag['href'])
|
||||||
elif tag.has_key('name') or tag.has_key('id'):
|
elif tag.has_key('name') or tag.has_key('id'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user