Problems with internal links/anchors in MOBI output from Kindlegen
Asked Answered
B

2

5

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?

Boleslaw answered 8/2, 2012 at 1:0 Comment(0)
A
8

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

Adkinson answered 8/2, 2012 at 3:13 Comment(0)
M
0

The resolution above didn't work for me, but made me think if all paragraph styles work properly on .mobi format. I had a decent EPUB file with a lot of references. They were coded as below:

 <li id="footnote-52"><strong style="font-size: 1em;"><a href="../Text/5.Rozdzial_V.xhtml#footnote-ref-52">↑[52]</a></strong></li>

The problem occurred, when I converted the file into mobi, the "a href=" attribute from the text was moving to the beginning of the references section, as there were no reference to move to.

The solution for this problem wasn't obvious. It turned out that the Kindle does not read "li" attribute. When I tried to change "li" to "p" or "h", everything began to work flawlessly. The solution:

<h6 id="footnote-52"><strong style="font-size: 1em;"><a href="../Text/5.Rozdzial_V.xhtml#footnote-ref-52">↑[52]</a></strong></h6>

Cheers

Manuel answered 16/5, 2018 at 12:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.