mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ignore yet more errors caused by corrupt MOBI files. Fixes #2023984 [[bug][convert] convert to epub raise indexerror](https://bugs.launchpad.net/calibre/+bug/2023984)
This commit is contained in:
parent
056220d2a7
commit
61ccbfc995
@ -274,7 +274,10 @@ def insert_images_into_markup(parts, resource_map, log):
|
|||||||
if tag.startswith('<im'):
|
if tag.startswith('<im'):
|
||||||
for m in img_index_pattern.finditer(tag):
|
for m in img_index_pattern.finditer(tag):
|
||||||
num = int(m.group(1), 32)
|
num = int(m.group(1), 32)
|
||||||
href = resource_map[num-1]
|
try:
|
||||||
|
href = resource_map[num-1]
|
||||||
|
except IndexError:
|
||||||
|
href = ''
|
||||||
if href:
|
if href:
|
||||||
replacement = '"%s"'%('../' + href)
|
replacement = '"%s"'%('../' + href)
|
||||||
tag = img_index_pattern.sub(replacement, tag, 1)
|
tag = img_index_pattern.sub(replacement, tag, 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user