epubcalibrekindlegen

Problems with internal links/anchors in MOBI output from Kindlegen


I've got a nicely structured EPUB file, and trying to generate a mobi file using KindleGen... The EPUB is filled with footnotes/annotations, which are internal links/anchors. All is well formatted, good HTML ... but the Kindlegen-created MOBI file chokes:

Converting with Calibre, there are no problems with links.

The code we're using is the following:

The NOTE link, from inside the text:

<a class="footnote" href="#footnote-3" id="return-footnote-3" title="Paul Johnson: Marks’s   
comments in this paragraph are excellent."><sup class="footnote">[3. Paul Johnson]</sup>
</a></p>

and the code for footnote back to note is:

<p id="footnote-3"><a class="return-footnote" href="#return-footnote-3">3. <cite>Paul Johnson:
</cite> Marks’s comments in this paragraph are excellent.</a></p> 

I tried pulling the anchor tags out, so:

<a id="return-footnote-3"></a> <a class="footnote" href="#footnote-3" title="Paul Johnson:    
Marks’s comments in this paragraph are excellent."><sup class="footnote">[3. Paul Johnson]
</sup></a></p>

But that didn't work.

Any thoughts? Suggestions?


Solution

  • After spending a few minutes playing with this, I have narrowed it down to (what seems to be) a bug in the Kindle Previewer and the various device apps.

    The "title" attribute within your [a] tag is breaking the link from the reference to the footnote. (The link from the footnote back to the reference works in all cases).

    However, the links work just fine when loaded on my actual Kindle (e-ink).

    Here is my expanded version of your list (above):

    Kindle Previewer:

    Kindle Apps:

    Devices:

    Bottom Line:

    I would consider this a bug that exists within the architecture of the Kindle Apps and previewer. But the devices do not seem to share the bug (as far as I am able to test anyway).

    Temporary Solution:

    Remove the "title" attribute from the [a] tag.

    If anyone else would like to give it a try on the Kindle Fire, Kindle DX, or any of the other Apps, that would be good information to add to this post.

    Cheers,

    Ron