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