From 29a459627090abb36084cba66a7baf293690b35a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Jan 2020 22:06:32 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/pdf/html_writer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/pdf/html_writer.py b/src/calibre/ebooks/pdf/html_writer.py index 9a97539efb..17db4bc616 100644 --- a/src/calibre/ebooks/pdf/html_writer.py +++ b/src/calibre/ebooks/pdf/html_writer.py @@ -1146,9 +1146,10 @@ def add_maths_script(container): def fix_markup(container): + xp = XPath('//h:canvas') for file_name, is_linear in container.spine_names: root = container.parsed(file_name) - for canvas in XPath('//h:canvas')(root): + for canvas in xp(root): # Canvas causes rendering issues, see https://bugs.launchpad.net/bugs/1859040 # for an example. canvas.tag = XHTML('div')