View Full Version : iBooks problem with text anchors


iain robinson
03-06-2012, 12:12 PM
Hi all

We're making ePUBs in Adobe Indesign CS5.5 and then manipulating them to suit our requirements. One requirement is that the customer wants links after each endnote that you can click on to take you back to the appropriate place in the text. I know that there is a link at the foot of the page iBooks for this anyway but the customer still wants it (will be useful on other devices no doubt). When the user clicks an endnote reference in the text it takes you to the endnotes (Indesign takes care of this bit) and we add programmatically some anchors to the endnote references in the text and then put a link to them after the endnote.

Problem is that in iBooks (v2.0.1) the links sometime don't lead you back to the correct reference. In an article with 10 endnotes for example, the first 4 will work as expected then 5-7 will take you back to note reference 4, then 8-10 will work okay. If I uncompress the ePUB and view the html file in Safari all the links work as expected. Is this an iBooks bug and if so how are other people getting round it?

An example of some code from the text;
<p class="main-text">And all because of a couple of pieces of legislation being discussed in the USA, the Stop Online Piracy Act and the Protect IP Act (SOPA<a id="Anchor-1031"></a><a href="#Anchor-31"><span class="superscript">1</span></a> and PIPA<a id="Anchor-1032"></a><a href="#Anchor-32"><span class="superscript">2</span></a> respectively).

An example of some code from the endnotes;
<ol>
<li class="endnotes"><a id="Anchor-31"/><a href="www.blahblah.com">www.blahblah.com</a>.<a href="#Anchor-1031" class="orange"> [BACK]</a></li>
<li class="endnotes"><a id="Anchor-32"/><a href="www.ihateibooks.com">www.ihateibooks.com.</a><a href="#Anchor-1032" class="orange"> [BACK]</a></li>

Any help gratefully received,
Iain

iain robinson
03-09-2012, 03:42 AM
Anybody?

pdurrant
03-09-2012, 04:51 AM
Very puzzling. No idea.

But note that your sample only includes two links that you say are working.

iain robinson
03-09-2012, 04:58 AM
Thanks for your reply. The code was just to show how we had done it - the coding for all the links is the same (with different Anchor ids obviously). And it works as expected on everything I've tested it on, except iBooks.

Just wondered if anyone has seen this before and have a workaround. Seems not!

Toxaris
03-09-2012, 07:56 AM
Did you also test it with ADE?

iain robinson
03-09-2012, 08:34 AM
I did test it in ADE, Sigil and (uncompressed) in Safari. All worked fine. However, I just tested another 'chapter' within the file in ADE and it is not working 100% consistently (but better than iBooks) - I must not have checked that particular file. The whole thing is just weird.

Does anyone want to look at a file?

pdurrant
03-09-2012, 11:32 AM
Having seen your file, it looks to me like its just a case of your anchors not being there in the HTML.