AZW3 Input: Fix svg images that use a prefix for the SVG namespace not being recognized. Fixes #1994988 [Pictures are missing when converting from Epub to Azw3](https://bugs.launchpad.net/calibre/+bug/1994988)

This commit is contained in:
Kovid Goyal 2022-10-30 19:27:12 +05:30
parent 2ee4970e12
commit d4bc5a73fd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -260,13 +260,14 @@ class Mobi8Reader:
# svg
typ = 'svg'
start = m.start()
m2 = image_tag_pattern.search(flowpart)
# strip off anything before <svg if inlining
from_svg = flowpart[start:]
m2 = image_tag_pattern.search(from_svg)
if m2 is not None:
format = 'inline'
dir = None
fname = None
# strip off anything before <svg if inlining
flowpart = re.sub(br'(</?)svg:', r'\1', flowpart[start:])
flowpart = from_svg
else:
format = 'file'
dir = "images"