![]() |
#1 |
Member
![]() Posts: 15
Karma: 10
Join Date: Apr 2013
Location: Finland
Device: Bookeen Cybook Muse Frontlight
|
Problems caused by <a> markup used for index markers
The command Ctrl+Shift+X creates an element of the form<a class="sigil_index_marker" title="...">...</a, and creating an index then causes an id attribute to be added to the element. While this is formally valid, it causes problems in Adobe Digital Editions, which handles any <a> element (even without a href attribute) as a link, displaying it in a link-like manner.
I though I had fixed this in CSS: .sigil_index_marker { text-decoration: none; color: inherit; cursor: text; } Now I was told that this does help in iBooks, which still shows the markers using a link color. Maybe this can be fixed by using black instead of inherit, but this is an ugly fix, and I cannot test this directly. I wonder if Sigil could be changed to use <span> instead of <a> for the index markers. This would avoid the problem and would be better in accordance with modern HTML style. I guess the difficult part would be to create compatibility, but I would expect that simply changing any <a> in class sigil_index_marker to <span>, when opening an existing .epub, would handle this. |
![]() |
![]() |
![]() |
#2 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Myself, I think this is a very small price to pay for the usability of the links. The reader needs to know what they are linking to, in addition to the functionality of jumping back and forth. How are you marking the indexed text, anyway? I mean, assume that you replaced the a's with spans--arguably, those would be invisible to the user, right? When the user jumps from the index to the indexed item, how on the page or pages would you propose that he knows where his eye is to go? If you are using an index that is somewhat like a TOC, and you are linking to named headers, I suppose that is less of a concern for you, but say you are linking to a conceptual paragraph--how would the reader know which paragraph on the page is related to that index item, just out of curiosity? I'm curious from a functionality standpoint. I assume you mean that each span would have its own ID...you could, you know, just do it quasi-manually. You could do all the indices, and then regex the targets to spans, I suppose? That might work, and you could style the spans as you wished, assuming you have a particular styling in mind. OR...it could just be that your base a styling is already set, or you haven't set it. Can you change your base anchor link styling, or do you need the blue links or (default display) link behavior elsewhere? Hitch Last edited by Hitch; 09-30-2013 at 06:48 PM. Reason: Edited dumb mistake |
|
![]() |
![]() |
![]() |
#3 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Anyway, if you want to mark with colors the index targets, you can do it with spans too. |
|
![]() |
![]() |
![]() |
#4 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
![]() |
![]() |
![]() |
#5 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Of course, the real solution would be to fix ADE and iBooks to not apply any default formatting to <a> elements without href (at least). |
|
![]() |
![]() |
![]() |
#6 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
In any event, we gave the OP a few ways to work around it. Hitch |
|
![]() |
![]() |
![]() |
#7 | ||||
Member
![]() Posts: 15
Karma: 10
Join Date: Apr 2013
Location: Finland
Device: Bookeen Cybook Muse Frontlight
|
Quote:
Quote:
Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
#8 | |||
Member
![]() Posts: 15
Karma: 10
Join Date: Apr 2013
Location: Finland
Device: Bookeen Cybook Muse Frontlight
|
Quote:
Quote:
Quote:
Semantically, an “a” element without “href” is just as empty as “span”. It has no meaning beyond the meanings of its attributes, i.e. it is just a text-level carrier of attributes. And according to HTML5 CR, which is virtually the de facto HTML standard, more or less, “If the a element has no href attribute, then the element represents a placeholder for where a link might otherwise have been placed, if it had been relevant, consisting of just the element's contents.” So it’s OK to use such an element in a navigation menu, for the item that would be a link to the current page, and is such a link on other pages. But the use of “a” without “href” just to mark a destination for links hardly fits into the definition. |
|||
![]() |
![]() |
![]() |
#9 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
![]() |
![]() |
![]() |
#10 | ||||
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Then, if you want to remove some instances, simply remove them from the index page in html. Is it a tad clunky? Yes, if you have numerous instances that you don't really want marked or included in the index, but it does solve the underscore-color issue and allows you to create a linked-from index in Sigil without the reader confusion, or by having to do it by hand. This actually works the same way (concordance-like) that most word-processors work; you indicate a list of terms, the word-processor finds all instances, and you build it last. The other method also works like most word-processors--even if you can't see it in the WYSIWYG, the x-ref marking is certainly there. FWIW, for anyone who comes along after, reading this thread, regexing the target a id's to spans works fine, and the book functions properly, and doesn't have any marking in ADE or iBooks. You may wish to consider doing the index editor-method when you have a single file, which means all your id's are sequential, but for very heavily-indexed books, you may prefer that each chapter restarts numbering, (which is what it does with each XHTML/HTML file, so you get links that include the filename and the id, e.g., "Chapter_0006.xhtml#sigil_index_id_1" as the a href link to. Quote:
Quote:
Quote:
Hitch |
||||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Markup for TTS? | jcsalomon | ePub | 4 | 06-19-2013 11:47 AM |
Index: Making a linked index in epub | virtual_ink | ePub | 21 | 10-19-2011 11:23 PM |
Textile markup | p3aul | Conversion | 4 | 05-17-2011 05:49 PM |
Command Line problems: ebook-convert, ebook-meta with tags: --series, --series-index | omnivorous | Calibre | 4 | 11-07-2010 02:42 PM |
Stop squinting - eyestrain problems caused by small screens | Alexander Turcic | News | 9 | 04-27-2006 03:29 AM |