From 91731ab5b87bb9fadb564f591a6feff25263bc21 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 23 Feb 2025 20:10:19 +0530 Subject: [PATCH] unkepubify: Remove kobo-style comments --- src/calibre/ebooks/oeb/polish/kepubify.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/oeb/polish/kepubify.py b/src/calibre/ebooks/oeb/polish/kepubify.py index 76b2a35a4b..7b0551d81f 100644 --- a/src/calibre/ebooks/oeb/polish/kepubify.py +++ b/src/calibre/ebooks/oeb/polish/kepubify.py @@ -115,6 +115,9 @@ def remove_kobo_styles_and_scripts(root): for script in XPath('//h:script')(root): if script.get('type') == 'text/javascript' and is_href_to_fname(script.get('src'), KOBO_JS_NAME): extract(script) + for comment in root.iter(tag=etree.Comment): + if comment.text == ' kobo-style ': # these are present in KEPUB from Kobo + extract(comment) def wrap_body_contents(body):