diff --git a/src/calibre/ebooks/oeb/polish/pretty.py b/src/calibre/ebooks/oeb/polish/pretty.py index 893fb569f6..94db83571d 100644 --- a/src/calibre/ebooks/oeb/polish/pretty.py +++ b/src/calibre/ebooks/oeb/polish/pretty.py @@ -106,7 +106,7 @@ def has_only_blocks(x): if x.text and not isspace(x.text): return False for child in x: - if not isblock(child) or (child.tail and isspace(child.tail)): + if not isblock(child) or (child.tail and not isspace(child.tail)): return False return True