diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py index 30791c8ed3..2a408c3f94 100644 --- a/src/calibre/ebooks/fb2/fb2ml.py +++ b/src/calibre/ebooks/fb2/fb2ml.py @@ -73,8 +73,9 @@ class FB2MLizer(object): return '\n' + output def clean_text(self, text): - # Remove empty tags. - text = re.sub(r'(?miu)<(strong|emphasis|strikethrough|sub|sup)>\s*\1>', '', text) + # Remove pointless tags, but keep their contents. + text = re.sub(r'(?miu)<(strong|emphasis|strikethrough|sub|sup)>(\s*)\1>', r'\2', text) + # Condense empty paragraphs into a line break. text = re.sub(r'(?miu)(
\s*
\s*){3,}', '