FB2 Output: Put line breaks between paragraphs on a separate line

This commit is contained in:
Andrey Efremov 2019-10-08 12:16:35 +07:00
parent 3b8d769128
commit cb45766216

View File

@ -103,6 +103,10 @@ class FB2MLizer(object):
if self.opts.insert_blank_line: if self.opts.insert_blank_line:
text = re.sub(r'(?miu)</p>', '</p><empty-line/>', text) text = re.sub(r'(?miu)</p>', '</p><empty-line/>', text)
# Put line breaks between paragraphs on a separate line.
text = re.sub(r'(?miu)</(p|title)>\s*<empty-line/>', r'</\1>\n<empty-line/>', text)
text = re.sub(r'(?miu)<empty-line/>\s*<p>', '<empty-line/>\n<p>', text)
return text return text
def fb2_header(self): def fb2_header(self):