mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-28 00:04:29 +01:00
FB2 Output: Put line breaks between paragraphs on a separate line
This commit is contained in:
parent
3b8d769128
commit
cb45766216
1 changed files with 4 additions and 0 deletions
|
|
@ -103,6 +103,10 @@ def clean_text(self, text):
|
|||
if self.opts.insert_blank_line:
|
||||
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
|
||||
|
||||
def fb2_header(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue