mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04: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
@ -79,7 +79,7 @@ class FB2MLizer(object):
|
|||||||
text = re.sub(r'(?mu)<(strong|emphasis|strikethrough|sub|sup)>(\s*)</\1>', r'\2', text)
|
text = re.sub(r'(?mu)<(strong|emphasis|strikethrough|sub|sup)>(\s*)</\1>', r'\2', text)
|
||||||
|
|
||||||
# Clean up paragraphs endings.
|
# 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.
|
# Condense empty paragraphs into a line break.
|
||||||
text = re.sub(r'(?mu)(?:<p></p>\s*){3,}', '<empty-line/>', text)
|
text = re.sub(r'(?mu)(?:<p></p>\s*){3,}', '<empty-line/>', text)
|
||||||
# Remove empty paragraphs.
|
# Remove empty paragraphs.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user