mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 21:53:43 +02:00
TXT Output: remove excessive newlines
This commit is contained in:
parent
3a0311d973
commit
5e65dd3499
1 changed files with 3 additions and 3 deletions
|
|
@ -32,7 +32,7 @@
|
|||
]
|
||||
|
||||
class TXTMLizer(object):
|
||||
|
||||
|
||||
def __init__(self, log):
|
||||
self.log = log
|
||||
|
||||
|
|
@ -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{3,}', '\n\n', text)
|
||||
|
||||
# Replace spaces at the beginning and end of lines
|
||||
text = re.sub('(?imu)^[ ]+', '', text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue