diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py index d57389445c..11596b9df9 100644 --- a/src/calibre/ebooks/fb2/fb2ml.py +++ b/src/calibre/ebooks/fb2/fb2ml.py @@ -91,7 +91,9 @@ class FB2MLizer(object): return u'\n%s' % etree.tostring(etree.fromstring(output), encoding=unicode, pretty_print=True) def clean_text(self, text): - text = re.sub('

\s*

', '', text) + text = re.sub(r'(?miu)

\s*

', '', text) + text = re.sub(r'(?miu)\s+

', '

', text) + text = re.sub(r'(?miu)

', '

\n\n

', text) return text