View Full Version : a href links working/not working


mimosawind
12-07-2011, 11:58 AM
I have a book which I need to link certain sections from one document to another - not a problem at all.
I verified the ePub to be sure all links were good and there were no other issues. Checked the ePub by opening it in ADE and Safari - looks great and the links work.
However when I add the book to my iBooks on the iPad, the links do not direct to the correct location, but rather to the very first 'page' (Title page) of the book.

So the a href's are working in ADE and Safari, but not in iBooks - anybody have an idea as to why?

I'm not even attempting to link to a certain section of the separate (but still in book) document - just going straight to the document.

I am thoroughly confused as to how it could work fine on my mac but not on the iPad.

I'm using Text Wrangler to do all of my html/css work and all of my documents are xhtml.

Serpentine
12-07-2011, 05:54 PM
Not that I use any terrible crapple specific stuff but:
Sounds like you've got some invalid characters (commas, colons etc) in the hrefs or using direct addressing; ie href="something.html#stuff" often causes trouble while href="../Text/something.html#stuff" will be fine.

Anyway, if you you need help, it's a good idea to provide us with an example(s), this regex :<a\b(?:\s*\w+="[^"]*")*\s*(href="[^"]+")(?:\s*\w+="[^"]*")*\s*> will grab all href's from <a> tags, group 1 contains just the href itself, if you could run this over your html and save the matches, that would be quite helpful.

mimosawind
12-08-2011, 12:20 PM
In all honesty, I have no clue how to use a regex... But here's the a href in the doc... And it just repeats a couple of times throughout the book.

<a href="../OEBPS/Note.xhtml">Note</a>

The document it's linking to is part of the ePub, and it is titled "Note.xhtml"

Like I said though - the links work perfectly fine except in iBooks.

Serpentine
12-08-2011, 06:18 PM
Hmm that's pretty odd, tho I'd throw it through Sigil / flightcheck and make sure that it doesn't complain about referenced files not being correctly included in the manifest etc.

theducks
12-08-2011, 10:09 PM
In all honesty, I have no clue how to use a regex... But here's the a href in the doc... And it just repeats a couple of times throughout the book.

<a href="../OEBPS/Note.xhtml">Note</a>

The document it's linking to is part of the ePub, and it is titled "Note.xhtml"

Like I said though - the links work perfectly fine except in iBooks.

Note the Case of the file name.ext in all usages (and the file).
It must be an exact match on all but Windows based systems. (Some systems may try to make this case insensitive, but don't ever count on it :rolleyes: )

mimosawind
12-09-2011, 12:42 PM
Checks out perfectly fine --- and I made sure to use proper casing for all the links. I have had issues caused from that already. This is such a mystery!