mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-25 13:56:08 +01:00
FB2 Output: Fix a regression in calibre 5 that caused paragraphs containing only non-breaking spaces to be removed. Fixes #1924232 [Empty lines missing after FB2 conversion](https://bugs.launchpad.net/calibre/+bug/1924232)
py3 compat \s+ matches nbsp in python 3 but not python2
This commit is contained in:
parent
3f2bc45368
commit
1c24a53865
1 changed files with 1 additions and 1 deletions
|
|
@ -79,7 +79,7 @@ def clean_text(self, text):
|
|||
text = re.sub(r'(?mu)<(strong|emphasis|strikethrough|sub|sup)>(\s*)</\1>', r'\2', text)
|
||||
|
||||
# Clean up paragraphs endings.
|
||||
text = re.sub(r'(?mu)\s+</p>', '</p>', text)
|
||||
text = re.sub(r'(?ma)\s+</p>', '</p>', text)
|
||||
# Condense empty paragraphs into a line break.
|
||||
text = re.sub(r'(?mu)(?:<p></p>\s*){3,}', '<empty-line/>', text)
|
||||
# Remove empty paragraphs.
|
||||
|
|
|
|||
Loading…
Reference in a new issue