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:
Kovid Goyal 2023-06-15 16:39:27 +05:30
parent 056220d2a7
commit 61ccbfc995
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -274,7 +274,10 @@ def insert_images_into_markup(parts, resource_map, log):
if tag.startswith('<im'):
for m in img_index_pattern.finditer(tag):
num = int(m.group(1), 32)
href = resource_map[num-1]
try:
href = resource_map[num-1]
except IndexError:
href = ''
if href:
replacement = '"%s"'%('../' + href)
tag = img_index_pattern.sub(replacement, tag, 1)