![]() |
#16 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,364
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
You could be right. It does't really affect me at all (mostly because I almost never have url frags in my ebook links).
I just worry about new users making a dog's lunch of things without realizing it. I know we can't save everyone from themselves, but I can't really see any downside to giving them a heads-up that they're about to do something risky, either. Yes the problematic link is technically broken already, but it will still get a reader to the right file even if the target id doesn't exist. I think the way the software currently works is fine, too. I just don't think a "here's what can go wrong IF..." warning could hurt either. It's a pretty drastic procedure to be kicked off with no confirmation. Last edited by DiapDealer; 06-23-2016 at 11:10 AM. |
![]() |
![]() |
![]() |
#17 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,685
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Not seeing a missing/invalid fragment id warning would also give users peace of mind that splitting files isn't likely to break any links. |
|
![]() |
![]() |
Advert | |
|
![]() |
#18 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,488
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi Diapdealer
Quote:
Not all of the time. Think of starting with one big xhtml file with unique ids and then splitting it into many files. The one big file no longer exists and you end up having no idea of which of the smaller file to actually link to since the id does not actually exist! So it looks like some sort of id/fragment check function needs to included right at the same point we do a well-formed check to make sure things are hunky-dory before splitting. That should be doable as we already have routines to get all ids defined across the book (using multiple threads so it is done concurrently) so before splitting we could walk the urls with fragments and verify if an "id" exists in that particular file. KevinH |
|
![]() |
![]() |
![]() |
#19 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,364
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I meant the "broken" link (file exists but fragment id does not) before any splitting.
Such a link will still take the reader to the beginning of that file (even if it includes an undefined url fragment id). It's LESS broken before the splitter gets a hold of it. ![]() Out of curiosity ... what does the splitter function currently do to a link that includes a non-existent file (but has no fragment)? Last edited by DiapDealer; 06-23-2016 at 12:34 PM. |
![]() |
![]() |
![]() |
#20 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,488
Karma: 5703586
Join Date: Nov 2009
Device: many
|
It will not match on it and therefore won't touch it.
|
![]() |
![]() |
Advert | |
|
![]() |
#21 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,364
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I really wouldn't want an undefined fragment id to prevent a user from saving the epub, or performing other automated tasks. It seems to me that splitting/merging is the only time such a thing would be critical. No? |
|
![]() |
![]() |
![]() |
#22 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,488
Karma: 5703586
Join Date: Nov 2009
Device: many
|
I am thinking of here:
void MainWindow::SplitOnSGFSectionMarkers() Right after it does this: Code:
// Check if data is well formed before splitting. if (!html_resource->FileIsWellFormed()) { QMessageBox::warning(this, tr("Sigil"), tr("Cannot split: %1 XML is not well formed").arg(html_resource->Filename())); return; } KevinH |
![]() |
![]() |
![]() |
#23 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,364
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Makes sense. I've you've not already dived into it, I wouldn't mind taking a bit of a stab at it. It doesn't seem like it's a very critical thing, so there's not a lot of pressure to get to get it done in a hurry.
Quote:
|
|
![]() |
![]() |
![]() |
#24 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,488
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
This bug is all yours. The other place to look for code is in Dialogs/ReportsWidgets at the LinksWidget.cpp which tests links. I have not looked at it yet. The UpdateAnchors code calls something in XhtmlDoc.cpp to get all the Ids but there mght be an interface in Book that invokes it as well. KevinH |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |