From d811b6364af58d7d5da2e97e9c259c6ecebdfd48 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 Mar 2026 11:33:46 +0530 Subject: [PATCH] Fix a bug in KEPUB markup removal when there are empty kobo spans --- src/calibre/ebooks/oeb/polish/kepubify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/kepubify.py b/src/calibre/ebooks/oeb/polish/kepubify.py index 2ade9b8819..9a40106332 100644 --- a/src/calibre/ebooks/oeb/polish/kepubify.py +++ b/src/calibre/ebooks/oeb/polish/kepubify.py @@ -271,7 +271,7 @@ def unwrap(span: etree.Element) -> None: if len(span): p.insert(idx, span[0]) else: - text = span.text + (span.tail or '') + text = (span.text or '') + (span.tail or '') if idx > 0: prev = p[idx-1] prev.tail = (prev.tail or '') + text