diff --git a/src/calibre/ebooks/pdb/output.py b/src/calibre/ebooks/pdb/output.py index 3b4065213e..4e76a2d298 100644 --- a/src/calibre/ebooks/pdb/output.py +++ b/src/calibre/ebooks/pdb/output.py @@ -47,10 +47,8 @@ class PDBOutput(OutputFormatPlugin): if Writer is None: raise PDBError('No writer available for format %s.' % format) - setattr(opts, 'flush_paras', False) setattr(opts, 'max_line_length', 0) setattr(opts, 'force_max_line_length', False) - setattr(opts, 'indent_paras', False) writer = Writer(opts, log) diff --git a/src/calibre/ebooks/txt/output.py b/src/calibre/ebooks/txt/output.py index 32bde90fe8..15db4b1974 100644 --- a/src/calibre/ebooks/txt/output.py +++ b/src/calibre/ebooks/txt/output.py @@ -33,9 +33,6 @@ class TXTOutput(OutputFormatPlugin): OptionRecommendation(name='inline_toc', recommended_value=False, level=OptionRecommendation.LOW, help=_('Add Table of Contents to beginning of the book.')), - OptionRecommendation(name='flush_paras', - recommended_value=False, level=OptionRecommendation.LOW, - help=_('Do not add a blank line between paragraphs.')), OptionRecommendation(name='max_line_length', recommended_value=0, level=OptionRecommendation.LOW, help=_('The maximum number of characters per line. This splits on ' @@ -47,9 +44,6 @@ class TXTOutput(OutputFormatPlugin): recommended_value=False, level=OptionRecommendation.LOW, help=_('Force splitting on the max-line-length value when no space ' 'is present. Also allows max-line-length to be below the minimum')), - OptionRecommendation(name='indent_paras', - recommended_value=False, level=OptionRecommendation.LOW, - help=_('Add a tab at the beginning of each paragraph.')), ]) def convert(self, oeb_book, output_path, input_plugin, opts, log): diff --git a/src/calibre/ebooks/txt/txtml.py b/src/calibre/ebooks/txt/txtml.py index 45383675b4..0f9700a124 100644 --- a/src/calibre/ebooks/txt/txtml.py +++ b/src/calibre/ebooks/txt/txtml.py @@ -98,18 +98,16 @@ class TXTMLizer(object): # Remove excessive newlines. text = re.sub('\n[ ]+\n', '\n\n', text) - if self.opts.flush_paras: + if self.opts.remove_paragraph_spacing: text = re.sub('\n{2,}', '\n', text) + text = re.sub('(?imu)^(?=.)', '\t', text) else: - text = re.sub('\n{3,}', '\n\n', text) + text = re.sub('\n{4,}', '\n\n\n', text) # Replace spaces at the beginning and end of lines text = re.sub('(?imu)^[ ]+', '', text) text = re.sub('(?imu)[ ]+$', '', text) - if self.opts.indent_paras: - text = re.sub('(?imu)^(?=.)', '\t', text) - if self.opts.max_line_length: max_length = self.opts.max_line_length if self.opts.max_line_length < 25 and not self.opts.force_max_line_length: diff --git a/src/calibre/gui2/convert/txt_output.py b/src/calibre/gui2/convert/txt_output.py index 2fc7f19908..b79cd5779c 100644 --- a/src/calibre/gui2/convert/txt_output.py +++ b/src/calibre/gui2/convert/txt_output.py @@ -19,7 +19,7 @@ class PluginWidget(Widget, Ui_Form): def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, 'txt_output', ['newline', 'max_line_length', 'force_max_line_length', - 'inline_toc', 'flush_paras', 'indent_paras']) + 'inline_toc']) self.db, self.book_id = db, book_id self.initialize_options(get_option, get_help, db, book_id) diff --git a/src/calibre/gui2/convert/txt_output.ui b/src/calibre/gui2/convert/txt_output.ui index 8e5429b0ce..11a38690b1 100644 --- a/src/calibre/gui2/convert/txt_output.ui +++ b/src/calibre/gui2/convert/txt_output.ui @@ -27,7 +27,7 @@ - + Qt::Vertical @@ -47,20 +47,6 @@ - - - - Do not add a blank line between paragraphs. - - - - - - - Add a tab at the beginning of each paragraph - - -