From 755be0abec67d46b611a88437ac477c6f7068c04 Mon Sep 17 00:00:00 2001 From: Gregory Khvatsky Date: Sun, 29 Aug 2021 15:43:48 +0300 Subject: [PATCH] Fix max-line-length option for TXT output --- src/calibre/ebooks/txt/txtml.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/txt/txtml.py b/src/calibre/ebooks/txt/txtml.py index a6bdd91226..9f78c33c0d 100644 --- a/src/calibre/ebooks/txt/txtml.py +++ b/src/calibre/ebooks/txt/txtml.py @@ -151,6 +151,9 @@ def cleanup_text(self, text): if self.opts.max_line_length: max_length = self.opts.max_line_length + if type(max_length) is not int: + max_length = int(max_length) + if self.opts.max_line_length < 25 and not self.opts.force_max_line_length: max_length = 25 short_lines = [] -- 2.30.2