Wrong links in the converted azw3 file

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

Bug Description

I'm converting a epub (or html) file to asw3 for Kindle PW using Calibre v. 4.99.4.
The problem is that when looking at the formats in edit book window from epub I have:

Code:
...
            <a href="test_1_split_001.html#a">Chapter 1</a><br class="calibre2"/>
            <a href="test_1_split_001.html#b">Chapter 2</a><br class="calibre2"/>
            <a href="test_1_split_001.html#c">Chapter 3</a><br class="calibre2"/>
            <a href="test_1_split_001.html#d">Chapter 4</a><br class="calibre2"/>
            <a href="test_1_split_001.html#e">Chapter 5</a></p>
...

while in the converted asw3 I get broken internal links. Looking at the debugging processed text parts, the links are correct, whereas in the final aws3 file, the links get corrupted. Any idea where is the issue?

- fragment from azw3 file in edit book window:
Code:

...
       <p class="small_font">
            <a href="part0000.html#1-9078b954d3aa4c44a865caf8b84b44a7">Chapter 1</a><br class="calibre2"/>
            <a href="part0000.html#1-9078b954d3aa4c44a865caf8b84b44a7">Chapter 2</a><br class="calibre2"/>
            <a href="part0000.html#1-9078b954d3aa4c44a865caf8b84b44a7">Chapter 3</a><br class="calibre2"/>
            <a href="part0000.html#1-9078b954d3aa4c44a865caf8b84b44a7">Chapter 4</a><br class="calibre2"/>
            <a href="part0000.html#1-9078b954d3aa4c44a865caf8b84b44a7">Chapter 5</a></p>

        <div class="calibre3" id="calibre_pb_0"></div>
...

Convert book 1 of 1 (Example book)
Processing archive...
Conversion options changed from defaults:
  output_profile: 'kindle'
  verbose: 2
  read_metadata_from_opf: '/tmp/calibre_4.99.4_tmp_ab_yhyos/ifdu3bg0.opf'
  chapter: '/'
  chapter_mark: 'rule'
  page_breaks_before: '/'
Resolved conversion options
calibre version: 4.99.4
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'breadth_first': False,
 'change_justification': 'original',
 'chapter': '/',
 'chapter_mark': 'rule',
 'comments': None,
 'cover': None,
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'dont_compress': False,
 'dont_package': False,
 'duplicate_links_in_toc': False,
 'embed_all_fonts': False,
 'embed_font_family': None,
 'enable_heuristics': False,
 'expand_css': False,
 'extra_css': None,
 'extract_to': None,
 'filter_css': '',
 'fix_indents': True,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x7f9fe75ef710>,
 'insert_blank_line': False,
 'insert_blank_line_size': 0.5,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 '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,
 'markup_chapter_headings': True,
 'max_levels': 5,
 'max_toc_links': 50,
 'minimum_line_height': 120.0,
 'mobi_toc_at_start': False,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'no_inline_toc': False,
 'output_profile': <calibre.customize.profiles.KindleOutput object at 0x7f9fe82a64d0>,
 'page_breaks_before': '/',
 'prefer_author_sort': False,
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': '/tmp/calibre_4.99.4_tmp_ab_yhyos/ifdu3bg0.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'renumber_headings': True,
 'replace_scene_breaks': '',
 'search_replace': '[]',
 'series': None,
 'series_index': None,
 'share_not_sync': False,
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'start_reading_at': None,
 'subset_embedded_fonts': False,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'toc_title': None,
 'transform_css_rules': '[]',
 'unsmarten_punctuation': False,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
InputFormatPlugin: HTML Input running
on /tmp/calibre_4.99.4_tmp_ab_yhyos/4lx8g7kp_pl_arc/content.opf
Parsing all content...
Manifest item 'toc.ncx' not found
Parsing test_1.html ...
Generating default TOC from spine...
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 6 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 7 items of level: div_1
Found 1 items of level: p_1
Ignoring level p_1
div_1 left margin stats: Counter()
div_1 right margin stats: Counter()
Cleaning up manifest...
Trimming unused files from manifest...
Creating AZW3 Output...
Serializing resources...
Splitting markup on page breaks and flow limits, if any...
  Splitting on page-break at id=calibre_pb_0
 Split into 2 parts
Creating KF8 output
 Generating in-line ToC
 Generating KF8 markup...
 Compressing markup...
 Creating indices...
AZW3 output written to /tmp/calibre_4.99.4_tmp_ab_yhyos/nrujbvs_.azw3

Revision history for this message
Seweryn Kokot (sewkokot) wrote :
Revision history for this message
John Howell (jhowell-o) wrote :

The HTML ids in the file are missing quotes, but that does not appear to be a factor.

The links convert properly in calibre 4.10.1 under Windows, but they are wrong when calibre portable 4.99.4 beta is used. Possibly Python 3 related?

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
Seweryn Kokot (sewkokot) wrote :

Thank you very much!

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

Other bug subscribers

Remote bug watches

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