diff --git a/src/calibre/ebooks/mobi/reader/markup.py b/src/calibre/ebooks/mobi/reader/markup.py index d558ce611a..be5193d348 100644 --- a/src/calibre/ebooks/mobi/reader/markup.py +++ b/src/calibre/ebooks/mobi/reader/markup.py @@ -100,7 +100,7 @@ def update_flow_links(mobi8_reader, resource_map, log): mr = mobi8_reader flows = [] - img_pattern = re.compile(r'''(<[img\s|image\s][^>]*>)''', re.IGNORECASE) + img_pattern = re.compile(r'''(<[img\s|image\s|svg:image\s][^>]*>)''', re.IGNORECASE) img_index_pattern = re.compile(r'''['"]kindle:embed:([0-9|A-V]+)[^'"]*['"]''', re.IGNORECASE) tag_pattern = re.compile(r'''(<[^>]*>)''') @@ -128,7 +128,7 @@ def update_flow_links(mobi8_reader, resource_map, log): srcpieces = img_pattern.split(flow) for j in range(1, len(srcpieces), 2): tag = srcpieces[j] - if tag.startswith(']*>)''', re.IGNORECASE) - image_tag_pattern = re.compile(br'''(]*>)''', re.IGNORECASE) + image_tag_pattern = re.compile(br'''(<(?:svg:)?image[^>]*>)''', re.IGNORECASE) for j in xrange(1, len(self.flows)): flowpart = self.flows[j] nstr = '%04d' % j @@ -243,7 +243,7 @@ class Mobi8Reader(object): dir = None fname = None # strip off anything before