From cb6abd912ef5124677b740a484cb99febf70f419 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 2 Apr 2020 22:37:20 +0530 Subject: [PATCH] HTMLZ Output: Fix SVG images that use xlink:href not working. Fixes #1869856 [Private bug](https://bugs.launchpad.net/calibre/+bug/1869856) --- src/calibre/ebooks/htmlz/oeb2html.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/htmlz/oeb2html.py b/src/calibre/ebooks/htmlz/oeb2html.py index 96847238d6..b99f3fe40b 100644 --- a/src/calibre/ebooks/htmlz/oeb2html.py +++ b/src/calibre/ebooks/htmlz/oeb2html.py @@ -192,6 +192,7 @@ class OEB2HTMLNoCSSizer(OEB2HTML): # Turn the rest of the attributes into a string we can write with the tag. at = '' for k, v in attribs.items(): + k = k.split('}')[-1] at += ' %s="%s"' % (k, prepare_string_for_xml(v, attribute=True)) # Write the tag. @@ -284,6 +285,7 @@ class OEB2HTMLInlineCSSizer(OEB2HTML): # Turn the rest of the attributes into a string we can write with the tag. at = '' for k, v in attribs.items(): + k = k.split('}')[-1] at += ' %s="%s"' % (k, prepare_string_for_xml(v, attribute=True)) # Turn style into strings for putting in the tag. @@ -376,6 +378,7 @@ class OEB2HTMLClassCSSizer(OEB2HTML): # Turn the rest of the attributes into a string we can write with the tag. at = '' for k, v in attribs.items(): + k = k.split('}')[-1] at += ' %s="%s"' % (k, prepare_string_for_xml(v, attribute=True)) # Write the tag.