TXT input Paragraph Style: single function failed

Bug #1973591 reported by horngping9
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

   System:
   Win10 64bit, install calibre-ebook 64bit version

   Case :Convert TXT (with markdown style)to Epub
    When I set "Paragraph Style: single" in TXT input parameter dialog window,
    last ok version is v5.39.0 , but after 5.39.1, this function failed.

    When failed,the output epub has the same result as Paragraph Style: block
    all lines in a chapter will merge in to a singe line.

     ex: input TXT with markdown:

     ## chapter
         line1.
         line2.

     when fail since 5.39.1 epub output:
      chapter
            line1.line2.

      before 5.39.0 ok version epub output:
       chapter
             line1.
             line2.

Revision history for this message
horngping9 (horngping9) wrote :
Download full text (4.5 KiB)

Conversion options changed from defaults:
  dehyphenate: False
  cover: 'e:\\TEMP\\calibre_d0kaco54\\_7c05ir7.jpeg'
  verbose: 2
  chapter: None
  paragraph_type: 'single'
  formatting_type: 'markdown'
  level1_toc: '//h:h1'
  output_profile: 'kindle_pw3'
  level2_toc: '//h:h2'
  italicize_common_cases: False
  read_metadata_from_opf: 'e:\\TEMP\\calibre_d0kaco54\\qrl111wr.opf'
  markdown_extensions: 'toc'
  change_justification: 'justify'
  txt_in_remove_indents: True
  remove_paragraph_spacing: True
  use_auto_toc: True
  disable_font_rescaling: True
  dont_split_on_page_breaks: True
  remove_paragraph_spacing_indent_size: 2.0
  unwrap_lines: False
  insert_blank_line: True
  format_scene_breaks: False
  toc_title: '目錄'
  remove_fake_margins: False
Resolved conversion options
calibre version: 5.39.0
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': 'justify',
 'chapter': None,
 'chapter_mark': 'pagebreak',
 'comments': None,
 'cover': 'e:\\TEMP\\calibre_d0kaco54\\_7c05ir7.jpeg',
 'debug_pipeline': None,
 'dehyphenate': False,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': True,
 'dont_split_on_page_breaks': True,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': False,
 'embed_font_family': None,
 'enable_heuristics': False,
 'epub_flatten': False,
 'epub_inline_toc': False,
 'epub_toc_at_end': False,
 'epub_version': '2',
 'expand_css': False,
 'extra_css': None,
 'extract_to': None,
 'filter_css': '',
 'fix_indents': True,
 'flow_size': 260,
 'font_size_mapping': None,
 'format_scene_breaks': False,
 'formatting_type': 'markdown',
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x0000021B3E439D30>,
 'insert_blank_line': True,
 'insert_blank_line_size': 0.5,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': False,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': '//h:h1',
 'level2_toc': '//h:h2',
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markdown_extensions': 'toc',
 'markup_chapter_headings': True,
 'max_toc_links': 50,
 'minimum_line_height': 120.0,
 'no_chapters_in_toc': False,
 'no_default_epub_cover': False,
 'no_inline_navbars': False,
 'no_svg_cover': False,
 'output_profile': <calibre.customize.profiles.KindlePaperWhite3Output object at 0x0000021B3E455370>,
 'page_breaks_before': "//*[name()='h1' or name()='h2']",
 'paragraph_type': 'single',
 'prefer_metadata_cover': False,
 'preserve_cover_aspect_ratio': False,
 'preserve_spaces': False,
 'pretty_print': True,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': 'e:\\TEMP\\calibre_d0kaco54\\qrl111wr.opf',
 'remove_fake_margins': False,
 'remove_first_image': False,
 'remove_paragraph_spacing': True,
 'remove_paragraph_spacing_indent_size': 2.0,
 'renumber_headings': True,
 'replace_scene_breaks': '',
 'search_replace': '[]',
 'series': None,
 'series_index': None,
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
...

Read more...

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1973591

Your lines are indented so the markdown processor considers them to be a
block quote. Unindent your lines and you will be fine. AKA use

## chapter 1
line1
line2

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
horngping9 (horngping9) wrote (last edit ):

I have set parameter: txt_in_remove_indents: True
That is ok before 5.39.0,but fail after 5.39.1

Retest with remove indent of lines,it still have the same fail result.

horngping9 (horngping9)
Changed in calibre:
status: Invalid → New
Revision history for this message
Kovid Goyal (kovid) wrote :

Works for me with

ebook-convert t.txt t.epub -dp --txt-in-remove-indents --paragraph-type=single

and your sample text in t.txt

Changed in calibre:
status: New → Invalid
Revision history for this message
horngping9 (horngping9) wrote (last edit ):

test cmd: ebook-convert t.txt t.epub -dp --txt-in-remove-indents --paragraph-type=single
it can do valid paragraph process , so there has parameters conflict with --paragraph-type=single .
My convert parameter had list on second comment. I used the parameters set for long time, until 5.39.1 faild.
Is there any parameter I misuse?

horngping9 (horngping9)
Changed in calibre:
status: Invalid → New
Revision history for this message
Kovid Goyal (kovid) wrote :

Go through the list and figure out what is causing the issue.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
horngping9 (horngping9) wrote :

After tested every parameter I found that check ther TXT Input dialog : "Remove indents at the beginning of lines" cause convert paragraph invalid. Uncheck it will convert valid paragraph

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.