![]() |
#1 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2019
Device: none
|
![]()
Am using anchor links but keep getting the following error when splitting at markers. I do not understand what the error is actually trying to tell me
Quote:
Code:
<li><a href="#editorial">From The Chief Editor's Desk</a></li><br> <ol> <li><a href="#page01">Casual Python, Part 1</a></li> <li><a href="#page02">PCLinuxOS Recipe Corner: Slow Cooker Asian Beef</a></li> <li><a href="#page03">ms_meme's Nook: Daddy Boot Up That Sixty-Four Bar</a></li> <li><a href="#page04">Short Topix: Assaults On Privacy Continue Unchecked</a></li> <li><a href="#page05">Inkscape Tutorial: Some Useful And Fun Extensions</a></li> <li><a href="#page06">Configuring CUPS-PDF</a></li> <li><a href="#page07">A Guided Tour Of The Data Facebook Uses To Target Ads</a></li> <li><a href="#page08">Alternatives To Dropbox, Part 3</a></li> <li><a href="#page09">PCLinuxOS Family Member Spotlight: masinick</a></li> <li><a href="#page10">One Way To Duplicate Your Installation On Another Computer</a></li> <li><a href="#page11">ms_meme's Nook: Swinging PCLOS Blues</a></li> <li><a href="#page12">PCLinuxOS Bonus Recipe Corner: Italian Sausage With Tomatoes And Penne</a></li> <li><a href="#page13">Configuring Late Model Epson Printers</a></li> <li><a href="#page14">Victory! Illinois Supreme Court Protects Biometric Privacy</a></li> <li><a href="#page15">PCLinuxOS Puzzled Partitions</a></li> <li><a href="#page16">Screenshot Showcase</a></li> </ol> <hr class="sigil_split_marker" /> <!-- editorial --> <a id="editorial"></a> <h3>From The Chief Editor's Desk</h3> Thanks for any and all help. |
|
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Here's the two relevant chunks:
Code:
<li><a href="#editorial">From The Chief Editor's Desk</a></li><br>
Code:
<hr class="sigil_split_marker" />
<!-- editorial -->
<a id="editorial"></a>
<h3>From The Chief Editor's Desk</h3>
Jump to the id="editorial" within the the same exact file. Because you are trying to SPLIT the id="editorial" into a different file, Sigil is warning you about it. You can split it anyway, your links will break, and you can manually correct your links. Or if you want it automated by Sigil, you can specify the file within the href. Let's say the file all this information is in a Chapter01.xhtml file: Chapter01.xhtml Code:
<li><a href="../Text/Chapter01.xhtml#editorial">From The Chief Editor's Desk</a></li><br> [...] <hr class="sigil_split_marker" /> <!-- editorial --> <a id="editorial"></a> <h3>From The Chief Editor's Desk</h3> Look for the id="editorial" in THIS SPECIFIC FILE (Chapter01.xhtml). When you then split it, Sigil should auto-update your links for you: After Sigil Split Chapter01.xhtml Code:
<li><a href="../Text/Chapter02.xhtml#editorial">From The Chief Editor's Desk</a></li><br> Code:
<!-- editorial -->
<a id="editorial"></a>
<h3>From The Chief Editor's Desk</h3>
Go look in Chapter02.xhtml, and jump to the id="editorial". Last edited by Tex2002ans; 02-04-2019 at 01:34 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,766
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Maybe we (Sigil) should see if we can better deal with naked fragments? I will look at the split code.
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,766
Karma: 6000000
Join Date: Nov 2009
Device: many
|
As far as I can tell from just eyeballing the code, the HasUndefinedURLFragments test code should properly handle this testcase as it detects empty filenames in URLs and assigns it to the filename being processed.
I will play around with this testcase to see what is going on. |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Not to say there might not be a bug in my code. ![]() When playing with the OP's sample code, Sigil, indeed, does not choke on the #editorial frag/id. It chokes on the first #pagexx frag/id that's missing from the sample. In my experience, Sigil will handle splitting a file similar to this so long as every fragment has a matching id. It shouldn't matter if the filename is not included. I fear the sample code isn't entirely representative of the specific warning message the OP is getting. Last edited by DiapDealer; 02-04-2019 at 02:20 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,766
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Okay, I just tested this with the following testsplit.epub (see attached), and Sigil properly handles split at markers with no error messages and properly groks and updates naked fragments..
So the test case presented to us is somehow suspect. In fact the presence of a unclosed br tag in the test case and li tags not inside an ol lead me to believe that the structure of the original html file was quite broken (or was broken when extracted) but still an unclosed br is not valid xhtml. Normally before running split on such a xhtml file, you should make sure you have actual xhtml code (for example br is a self-closing tag and needs to be closed in xhtml) and that it passes is actually parseable. Spliting unparseable broken code is not in anyone's best interest. My guess is the actual case had an undeclared fragment, and Sigil did what it was supposed to and warned about it. Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <p><a href="#editorial">From The Chief Editor's Desk</a></p> <ol> <li><a href="#page01">Casual Python, Part 1</a></li> <li><a href="#page02">PCLinuxOS Recipe Corner: Slow Cooker Asian Beef</a></li> <li><a href="#page03">ms_meme's Nook: Daddy Boot Up That Sixty-Four Bar</a></li> <li><a href="#page04">Short Topix: Assaults On Privacy Continue Unchecked</a></li> <li><a href="#page05">Inkscape Tutorial: Some Useful And Fun Extensions</a></li> <li><a href="#page06">Configuring CUPS-PDF</a></li> <li><a href="#page07">A Guided Tour Of The Data Facebook Uses To Target Ads</a></li> <li><a href="#page08">Alternatives To Dropbox, Part 3</a></li> <li><a href="#page09">PCLinuxOS Family Member Spotlight: masinick</a></li> <li><a href="#page10">One Way To Duplicate Your Installation On Another Computer</a></li> <li><a href="#page11">ms_meme's Nook: Swinging PCLOS Blues</a></li> <li><a href="#page12">PCLinuxOS Bonus Recipe Corner: Italian Sausage With Tomatoes And Penne</a></li> <li><a href="#page13">Configuring Late Model Epson Printers</a></li> <li><a href="#page14">Victory! Illinois Supreme Court Protects Biometric Privacy</a></li> <li><a href="#page15">PCLinuxOS Puzzled Partitions</a></li> <li><a href="#page16">Screenshot Showcase</a></li> </ol> <hr class="sigil_split_marker"/> <!-- editorial --> <a id="editorial"></a> <h3>From The Chief Editor's Desk</h3> <p id="page01">Page 01 </p> <p id="page02">Page 02 </p> <p id="page03">Page 03 </p> <p id="page04">Page 04 </p> <p id="page05">Page 05 </p> <p id="page06">Page 06 </p> <p id="page07">Page 07 </p> <p id="page08">Page 08 </p> <p id="page09">Page 09 </p> <p id="page10">Page 10 </p> <p id="page11">Page 11 </p> <p id="page12">Page 12 </p> <p id="page13">Page 13 </p> <p id="page14">Page 14 </p> <p id="page15">Page 15 </p> <p id="page16">Page 16 </p> </body> </html> Last edited by KevinH; 02-04-2019 at 04:40 PM. |
![]() |
![]() |
![]() |
#7 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
I originally built my ebooks as a single html file (zipped with images if there were any) so I regularly used the # in links. When I switched to Sigil-built epub, what Tex describes here is exactly the way it worked (and continues to work) for me. Indeed, one of the things I loved about Sigil was the way it split a file so neatly, recapitulating the CSS link and handling hotlinks across the new divide.
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,766
Karma: 6000000
Join Date: Nov 2009
Device: many
|
It still works that way. It handles href="#editorial" just fine during the split (see my test case). The problem is the op posted a snippet of xhtml that "showed the problem" when in fact, it does not. So the op must have edited the snippet of xhtml in a way to make an id="editorial" exist when it did not in the original. Otherwise he would not have received that warning.
To illustrate this remove the id="page09" attribute from my test case shown above and Sigil will now happily warn you that an href="#page09" does not have a valid destination and so is a broken link that can not be updated. |
![]() |
![]() |
![]() |
#9 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
youcantoo or Notjohn, do you attach an actual EPUB that actually recreates OP's issue? I tested on a few of my latest books, and the split code works exactly like KevinH said. And it leaves me scratching my head, because I know I've seen the OP's issue many times over the years. (Although I just throw away all link code and recreate clean links on my own, so it never really bothered me.) (I'm going to dig through some of my EPUBs and see if I can get a good testcase. And I'll definitely keep my eye out on this in the future.) Quote:
I know Finereader sometimes creates some poor code (and maybe this is when I'm splitting files and seeing the error, when it's still in an invalid state). Last edited by Tex2002ans; 02-05-2019 at 03:57 PM. |
||
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Remember that it's a warning and not an error.
![]() Before I added the frag warning, Sigil would silently mess things like this up in the background. You only found out later that something bad had happened. Splitting can result in invalid "naked," (file-less) frags if their corresponding target is missing, but Sigil never really had an issue with "naked" frags that started out valid and had valid targets before the spit operation was initiated. Last edited by DiapDealer; 02-06-2019 at 06:05 AM. |
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2019
Device: none
|
Thanks for everyones help
I am looking through the code and have spotted several minor mistakes. I will get them corrected over the next few days and will let you know if it works. I do want to thank each and everone of you for your comments and suggestions.
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
In addition to making sure the xhtml is valid before performing operations like this, there's a Links Report (Tools->Reports) which has "Target ID" and "Target Exists?" columns that can be very helpful in (pre)diagnosing potential Splitting issues.
Last edited by DiapDealer; 02-07-2019 at 05:27 AM. |
![]() |
![]() |
![]() |
#13 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
|
![]() |
![]() |
![]() |
#14 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2019
Device: none
|
Quote:
Thanks for the information |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why do mismatched link and anchor work? | Abull | Editor | 3 | 06-13-2014 01:00 AM |
epub iBook link-anchor | dicknskip | Sigil | 1 | 04-04-2013 01:28 AM |
Anchor in Kindle | quocsan | Kindle Formats | 4 | 10-22-2012 10:03 PM |
simple anchor link question | affa | ePub | 1 | 04-20-2011 04:29 AM |