hyperlink conversion to azw3 and display on kindle

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

Bug Description

I have the following html part:

<p>text to explain one<a href="#id1">[1]</a></p>
<p>text to explain two<a href="#id2">[2]</a></p>
<p><a name=id1><b>1. </b>explanation one</p>
<p><a name=id2><b>2. </b>explanation two</p>

If i convert this to azw3, the result is this:

<p class="calibre1">text to explain one<a class="calibre2" href="part0000.html#id1">[1]</a></p>

<p class="calibre1">text to explain two<a class="calibre2" href="part0000.html#id2">[2]</a></p>

<p class="calibre1"><a class="calibre2" id="id1" name="id1"><b class="calibre3">1. </b>explanation one</a></p><a class="calibre2" id="id1" name="id1">

</a><p class="calibre1"><a class="calibre2" id="id1" name="id1"></a><a class="calibre2" id="id2" name="id2"><b class="calibre3">2. </b>explanation two</a></p><a class="calibre2" id="id2" name="id2">

</a>

In the second segment you can see an extra <a class="calibre2" id="id1" name="id1"></a> , which confuse the Kindle4 reader. If i read the book in Calibre, and click on the first hyperlink, it's correctly jumping to the first target. However, if i am using the Kindle reader, it's jump to the second - wrong - target. If i convert same text to mobi, and open it on the Kindle4 reader, it works fine. If i remove this extra part from the code by the editing the book, and upload, it works fine.

If i have more hyperlinks in the text, it's become more messy, and the id's wondering around.

calibre version 2.27

Madar (madar2252)
description: updated
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1454199

Your HTML is malformed. Close the <a name> tags properly and you will be
fine. If you do not do that, they will be closed automatically, which
will lead to the situation you have.

 status invalid

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

I will add some code to the azw3 output in the next release, to detect
and remove duplicate anchors, but you really should fix your HTML.

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 Friday.

 status fixreleased

Changed in calibre:
status: Invalid → Fix Released
Revision history for this message
Madar (madar2252) wrote :

Yes, is my bad, i fixed my html, sorry for the trouble, and thank you for the answer.

Have a nice day!

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.