From 79006c3460a3e679a3d479faa1d4f292fb8dce3b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 25 May 2022 12:51:21 +0530 Subject: [PATCH] TXT Input: Fix a regression in 5.39 that caused the option to remove indents also removing blank lines. Fixes #1973591 [TXT input Paragraph Style: single function failed](https://bugs.launchpad.net/calibre/+bug/1973591) --- src/calibre/ebooks/txt/processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/txt/processor.py b/src/calibre/ebooks/txt/processor.py index afeb93bc1f..3f427d1f37 100644 --- a/src/calibre/ebooks/txt/processor.py +++ b/src/calibre/ebooks/txt/processor.py @@ -220,7 +220,7 @@ def remove_indents(txt): ''' Remove whitespace at the beginning of each line. ''' - return re.sub(r'^\s+', '', txt, flags=re.MULTILINE) + return re.sub(r'^[\r\t\f\v ]+', r'', txt, flags=re.MULTILINE) def opf_writer(path, opf_name, manifest, spine, mi):