Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • Kindle Fire - all is well
  • Kindle - links don't work
  • Kindle DX - links don't work
  • Kindle iPhone - links work in Previewer, but not on my iPhone
  • Kindle iPad - links don't work

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?

like image 974
Hugh McGuire Avatar asked Feb 08 '12 01:02

Hugh McGuire


1 Answers

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 Fire: all is well
  • Kindle: link from reference to footnote does not work
  • Kindle DX: link from reference to footnote does not work
  • Kindle iPhone: all is well
  • Kindle iPad: all is well

Kindle Apps:

  • Mac: link from reference to footnote does not work
  • iPhone: link from reference to footnote does not work
  • iPad: link from reference to footnote does not work
  • I do not have the other apps available to test

Devices:

  • Kindle: all is well
  • Kindle Fire: Do not have one available to test
  • Kindle DX: Do not have one, but would assume that the links work correctly as with it's little borther, Kindle

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

like image 59
Ron Bilodeau Avatar answered Dec 28 '22 06:12

Ron Bilodeau