MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Sigil TOC breaks internal links (https://www.mobileread.com/forums/showthread.php?t=221559)

LarsEighner 09-03-2013 06:19 AM

Sigil TOC breaks internal links
 
I could be wrong, but appears to me that when Sigil generates a TOC it 1) changes all existing ids to classes and 2) substitutes its own id, without adjusting existing internal links.

This breaks all internal links. I find it hard to call this anything other than a bug.


In addition there is a remote the risk that the class will coincide with a class that is already being used for something else in the stylesheet, so the element will appear with a style that is not intended.

theducks 09-03-2013 11:23 AM

Quote:

Originally Posted by LarsEighner (Post 2611356)
I could be wrong, but appears to me that when Sigil generates a TOC it 1) changes all existing ids to classes and 2) substitutes its own id, without adjusting existing internal links.

This breaks all internal links. I find it hard to call this anything other than a bug.


In addition there is a remote the risk that the class will coincide with a class that is already being used for something else in the stylesheet, so the element will appear with a style that is not intended.

Not true on many levels unless you go out of your way to cause the clash in selectors.


Sigil selectors have:
1) SGC in their name
2) Toc Selectors (sigil 6+) have a separate SGC_TOC stylesheet that only links to the HTML TOC. The selectors are sigil_toc_id_N


Generating a TOC (NCX) leaves id='s as they were and only assigns new (Sigil) ones if they were missing. The before and after of generating both TOC

Code:

<h2 class="calibre5"><span class="ts"><a href="../Text/inline_toc40.xhtml#13">Chapter 3</a></span></h2>

There is 1 case I have found that does cause (always has) if you split off a file with one:
<h2 class="calibre5"><span class="ts"><a href="../Text/#13">Chapter 3</a></span></h2>

Relative references after a split will leave orphans in all other locations.

This could be avoided by 'precleaning' the files to change all relative references to absolute references (insert the full file name)

This is not an issue if that form is not ever used :smack:


All times are GMT -4. The time now is 06:49 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.