mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
AZW3 Output: Dont choke on invalid links in the input document
This commit is contained in:
parent
09af49caa6
commit
b72a3f8e79
@ -230,7 +230,11 @@ class KF8Writer(object):
|
||||
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…
x
Reference in New Issue
Block a user