mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
TXT Output: remove excessive newlines
This commit is contained in:
parent
3a0311d973
commit
5e65dd3499
@ -90,8 +90,8 @@ class TXTMLizer(object):
|
|||||||
text = re.sub('[ ]+', ' ', text)
|
text = re.sub('[ ]+', ' ', text)
|
||||||
|
|
||||||
# Remove excessive newlines.
|
# Remove excessive newlines.
|
||||||
#text = re.sub('\n[ ]+\n', '\n\n', text)
|
text = re.sub('\n[ ]+\n', '\n\n', text)
|
||||||
#text = re.sub('\n{3,}', '\n\n', text)
|
text = re.sub('\n{3,}', '\n\n', text)
|
||||||
|
|
||||||
# Replace spaces at the beginning and end of lines
|
# Replace spaces at the beginning and end of lines
|
||||||
text = re.sub('(?imu)^[ ]+', '', text)
|
text = re.sub('(?imu)^[ ]+', '', text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user