mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-04 10:46:05 +01:00
Remove excessive newlines from TXT output.
This commit is contained in:
parent
857f55d2b1
commit
1f014caf44
1 changed files with 2 additions and 2 deletions
|
|
@ -90,8 +90,8 @@ def cleanup_text(self, text):
|
|||
text = re.sub('[ ]+', ' ', text)
|
||||
|
||||
# Remove excessive newlines.
|
||||
#text = re.sub('\n[ ]+\n', '\n\n', text)
|
||||
#text = re.sub('\n{3,}', '\n\n', text)
|
||||
text = re.sub('\n[ ]+\n', '\n\n', text)
|
||||
text = re.sub('\n{5,}', '\n\n\n\n', text)
|
||||
|
||||
# Replace spaces at the beginning and end of lines
|
||||
text = re.sub('(?imu)^[ ]+', '', text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue