From eada4af1f10cab2808c0d7bd7dcfa8fac3b9f349 Mon Sep 17 00:00:00 2001 From: kthoden Date: Fri, 19 Jul 2019 13:48:39 +0200 Subject: [PATCH] Remove only if present --- imxml2epub.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imxml2epub.py b/imxml2epub.py index da6b902..ba3fa58 100755 --- a/imxml2epub.py +++ b/imxml2epub.py @@ -1156,7 +1156,8 @@ class FootnoteError(Exception): if xmlChild.tag == "item": xmlChild.tag = "dd" del xmlChild.attrib["id"] - del xmlChild.attrib["id-text"] + if xmlChild.get("id-text"): + del xmlChild.attrib["id-text"] logging.info(f"{logseparator}Preparing Blockquotes") xmlParagraphs = xmlEbookTree.findall(".//p")