Fix a bug in KEPUB markup removal when there are empty kobo spans

This commit is contained in:
Kovid Goyal 2026-03-08 11:33:46 +05:30
parent d57f3c0a07
commit d811b6364a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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