From cb45766216929a28fc21e128f963006f37a1ffb9 Mon Sep 17 00:00:00 2001
From: Andrey Efremov
Date: Tue, 8 Oct 2019 12:16:35 +0700
Subject: [PATCH] FB2 Output: Put line breaks between paragraphs on a separate
line
---
src/calibre/ebooks/fb2/fb2ml.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py
index a5745e1bc2..433db22fa1 100644
--- a/src/calibre/ebooks/fb2/fb2ml.py
+++ b/src/calibre/ebooks/fb2/fb2ml.py
@@ -103,6 +103,10 @@ class FB2MLizer(object):
if self.opts.insert_blank_line:
text = re.sub(r'(?miu)
', '', text)
+ # Put line breaks between paragraphs on a separate line.
+ text = re.sub(r'(?miu)(p|title)>\s*', r'\1>\n', text)
+ text = re.sub(r'(?miu)\s*', '\n
', text)
+
return text
def fb2_header(self):