![]() |
#1 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
Split on Markers --- Breaks existing links
Using v 0.8.6 portable on Win8.1 (also tried with v 0.9.5 portable on Win7).
I have the split markers inserted, as I always do. I have a separate xhtml file as a List of Illustrations, with links to the divs holding the images. I have another separate Footnotes file, also with links. When I use the command "Split at Markers" --- The Footnotes links update automatically, as they should, going from this: Code:
<body> <div class="chaphead"> <h2 class="botmspace" id="fnot">FOOTNOTES:<br /> </h2> </div> <div class="fnote"> <a href="../Text/TENT.xhtml#fnc-01" id="fnt-01">[1] —</a> The ordinary ..... </div> <div class="fnote"> <a href="../Text/TENT.xhtml#fnc-02" id="fnt-02">[2] —</a> When this .... </div> Code:
<body> <div class="chaphead"> <h2 class="botmspace" id="fnot">FOOTNOTES:<br /> </h2> </div> <div class="fnote"> <a href="../Text/TENT_0004.xhtml#fnc-01" id="fnt-01">[1] —</a> The ordinary .... </div> <div class="fnote"> <a href="../Text/TENT_0008.xhtml#fnc-02" id="fnt-02">[2] —</a> When this .... </div> The LOI, however, goes from this: Code:
<body> <div class="chaphead"> <h2 id="loi" title="List of Illustrations">ILLUSTRATIONS</h2> </div> <div class="fmattr"> <div class="sgc-toc-level-p"> <a href="../Text/TENT.xhtml#ttd-01">It was ...</a> </div> <div class="sgc-toc-level-p"> <a href="../Text/TENT.xhtml#ttd-02">A marvel...</a> </div> <div class="sgc-toc-level-p"> <a href="../Text/TENT.xhtml#ttd-03">We anointed ...</a> </div> Code:
<body> <div class="chaphead"> <h2 id="loi" title="List of Illustrations">ILLUSTRATIONS</h2> </div> <div class="fmattr"> <div class="sgc-toc-level-p"> <a href="../Text/#ttd-01">It was...</a> </div> <div class="sgc-toc-level-p"> <a href="../Text/#ttd-02">A marvel...</a> </div> <div class="sgc-toc-level-p"> <a href="../Text/#ttd-03">We anointed...</a> </div> I have not had this problem since v 0.7.4. (see here: https://www.mobileread.com/forums/sho...d.php?t=231360 ) Obviously, there must be something peculiar to the book I am currently editing, but I can't find the gremlin. I am attaching the UN-SPLIT draft versions of both the books, in case better eyes than mine (meaning 99% of the planet's population) can find a reason for the different behaviors. (By the way, it made no difference whether or not the images were included in the epub, so I deleted those for the attached files.) Here, I am only dealing with 19 broken links, and it would not be too painful to correct them manually, but I have an up-coming project with several hundred links, and I want to correct my bad behavior before I dig into that one. Thanks very much for any advice! ![]() |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
@GrannyGrump: I checked TENT--SPLIT-WONT-WORK.epub with epubcheck and found lots of missing fragment ids for LOI targets:
Spoiler:
Did you by any chance remove them before attaching it to your post? |
![]() |
![]() |
![]() |
#3 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
I will be double-dipped in dragon spit. All my image id's are missing.
Let me patch those right quick, and I bet that is the problem. Thank you, oh mighty eagle-eyes! |
![]() |
![]() |
![]() |
#4 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
That was absolutely it, and bless you for helping me.
(You may snicker quietly to yourself if you like, I certainly deserve it!) Gold stars and chocolate-chip cookies for you! |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,570
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Interesting. So if the target fragment/id is not found, the file name portion of the href disappears upon splitting. Have to see if something could be done about that. Wouldn't think that would be desirable.
![]() Thanks for the examples (and for your eyes, Doitsu)! I'd seen this effect crop up from time to time, but never really figured out under exactly which circumstances it happened. Good to know it can be avoided by validating (EpubCheck) before splitting, but it really shouldn't be happening, in my opinion, regardless. That's a fairly destructive side-effect. Last edited by DiapDealer; 06-23-2016 at 07:37 AM. |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Since the built-in Sigil Reports tool (Tools > Reports > Links), can detect broken links, maybe you could recycle the Reports tool link check code to run a quick link check before splitting chapters?
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,570
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
That's certainly a possibility, but I'm hoping we can do better than checking first and then aborting a split if the situation is found. We should (he said tentatively--not having examined the code in question
![]() It's worth pointing out that Flightcrew doesn't report the "Fragment identifier not defined" error like EpubCheck does. Probably a big part of the reason this issue has escaped being nailed down for so long. And it's been around a looooong time. Last edited by DiapDealer; 06-23-2016 at 07:38 AM. |
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
The user could then either cancel splitting and fix all fragment id issues or go ahead with the splitting knowing full well that s/he will have to eventually fix them. |
|
![]() |
![]() |
![]() |
#10 |
Unicycle Daredevil
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,944
Karma: 185432100
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
|
![]() |
![]() |
![]() |
#11 |
why in?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,630
Karma: 29896776
Join Date: Apr 2012
Device: Sony PRS-350, Kobo Aura
|
Sounds impossible to me. If the id isn’t present, there’s no way of determining for the software in which of the split files the id is supposed to be (as long as the software can’t look into the e-book producer’s brain, which, ahem, it shouldn’t).
|
![]() |
![]() |
![]() |
#12 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
I'm just happy to know I need to run epubcheck BEFORE I split. Always previously, that was almost the last thing I did. I need to get the habit of running it periodically during the entire editing process.
And I love my desktop Pagina Epubcheck, it's just so cute and cuddly! |
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
|
And pynch is correct here.
The routine in question is SourceUpdates/AnchorUpdates.cpp in the routine: void AnchorUpdates::UpdateAllAnchorsWithIDs(const QList<HTMLResource *> &html_resources) The only way to determine in which of the newly split files an anchor ends up is for the achor to have actually existed previously! There is simply no way to tell if a non-existent id was before the split or after the split or almost anyplace if multiple splits are done. The update anchor routine builds a list of all actual ids locations and uses that to determine which of the newly split files that link should be changed to. So there is no way to really fix it, we can in fact detect if a link fragment is not an actual ID and then ignore changing that link at all but that is still a very broken link that does nothing. It is the location of the id itself which determines which file it should be changed to. Unfortunately, this routine is invoked only *after* the physical split (and the assigning of filenames)and so we simply can not abort it without lots of broken links. Perhaps a better solution would be to replace the file portion for non-existing fragment ids with a placeholder, something along the lines of: UNKNOWN_LINK_BECAUSE_FRAGMENT_ID_DOES_NOT_EXIST or some other ridiculously long string that could easily be searched for to make things more obvious that there is no way to update a link that has a fragment id if that fragment id does not exist when splitting the file. KevinH |
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,570
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Shows what I know.
![]() What about a nag screen before splitting asking if the user wants to run a broken link check first? Last edited by DiapDealer; 06-23-2016 at 10:07 AM. |
![]() |
![]() |
![]() |
#15 |
why in?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,630
Karma: 29896776
Join Date: Apr 2012
Device: Sony PRS-350, Kobo Aura
|
I don’t really see a problem with how the software currently works. It doesn’t actually break the links, as they were broken before.
And the way it currently works makes it easy—at least for people who always use full links with the file name and the id—to spot broken links when they search for /# . |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating links in an existing epub-text? | Chris_ | Editor | 3 | 07-06-2015 06:10 PM |
When you split a file does Sigil update links? | JimmyG | Sigil | 2 | 10-31-2013 01:02 PM |
How to create TOC, what does split on SGF markers mean? | neonbible | Sigil | 18 | 01-23-2011 06:22 AM |
Existing links forum removed | Alexander Turcic | Announcements | 0 | 11-17-2002 04:06 PM |
Existing links now updated | Alexander Turcic | Announcements | 0 | 10-27-2002 08:55 AM |