Fix extraction of images from some MOBI files

This commit is contained in:
Kovid Goyal 2008-10-10 12:56:07 -07:00
parent a2a2ad3ef1
commit 5d156e7d83

View File

@ -391,7 +391,9 @@ class MobiReader(object):
def fix_images(match): def fix_images(match):
tag = match.group() tag = match.group()
for pat in (r'\shirecindex=[\'"](\d+)[\'"]', '\srecindex=[\'"](\d+)[\'"]', '\slorecindex=[\'"](\d+)[\'"]'): for pat in (r'\shirecindex=[\'"]{0,1}(\d+)[\'"]{0,1}',
'\srecindex=[\'"]{0,1}(\d+)[\'"]{0,1}',
'\slorecindex=[\'"]{0,1}(\d+)[\'"]{0,1}'):
pat = re.compile(pat) pat = re.compile(pat)
m = pat.search(tag) m = pat.search(tag)
if m: if m: