diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py
index 3a191cd54e..91d05f0140 100644
--- a/src/calibre/ebooks/fb2/fb2ml.py
+++ b/src/calibre/ebooks/fb2/fb2ml.py
@@ -78,7 +78,7 @@ class FB2MLizer(object):
# Clean up pargraph endings.
text = re.sub(r'(?miu)\s*
', '', text)
# Put paragraphs following a paragraph on a separate line.
- text = re.sub(r'(?miu)\s*', '
\n\n', text)
+ text = re.sub(r'(?miu)
\s*', '
\n', text)
# Remove empty title elements.
text = re.sub(r'(?miu)
\s*', '', text)
@@ -88,11 +88,11 @@ class FB2MLizer(object):
text = re.sub(r'(?miu)', '', text)
# Clean up sections start and ends.
text = re.sub(r'(?miu)\s*', '\n', text)
- text = re.sub(r'(?miu)\s*', '\n\n', text)
+ text = re.sub(r'(?miu)\s*', '\n', text)
text = re.sub(r'(?miu)\s*', '\n', text)
text = re.sub(r'(?miu)\s*', '\n', text)
# Put sectnions followed by sections on a separate line.
- text = re.sub(r'(?miu)\s*\n\n', text)
+ text = re.sub(r'(?miu)\s*\n', text)
if self.opts.insert_blank_line:
text = re.sub(r'(?miu)', '', text)
@@ -223,7 +223,7 @@ class FB2MLizer(object):
\n''') % metadata
def fb2_footer(self):
- return '\n'
+ return ''
def get_cover(self):
from calibre.ebooks.oeb.base import OEB_RASTER_IMAGES
@@ -291,7 +291,8 @@ class FB2MLizer(object):
text.append('')
self.section_level -= 1
- return ''.join(text) + '