mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 16:43:40 +02:00
AZW3 Output: Dont choke on invalid links in the input document
This commit is contained in:
parent
09af49caa6
commit
b72a3f8e79
1 changed files with 5 additions and 1 deletions
|
|
@ -230,7 +230,11 @@ def replace_internal_links_with_placeholders(self):
|
|||
count += 1
|
||||
ref = item.abshref(a.get('href'))
|
||||
href, _, frag = ref.partition('#')
|
||||
href = urlnormalize(href)
|
||||
try:
|
||||
href = urlnormalize(href)
|
||||
except ValueError:
|
||||
# a non utf-8 quoted url? Since we cannot interpret it, pass it through.
|
||||
pass
|
||||
if href in hrefs:
|
||||
placeholder = 'kindle:pos:fid:0000:off:%s'%to_href(count)
|
||||
self.link_map[placeholder] = (href, frag)
|
||||
|
|
|
|||
Loading…
Reference in a new issue