|
|
#16 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,950
Karma: 212736643
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
That's exactly what I was NOT saying Jon. I KNOW Mobileread will butcher entities. What I am trying to determine (and you are interfering with) is whether it was Sigil that was butchering that particular entity. Which would be a bug. Please, please, please stop interfering when I am in the process of debugging something. You always tend to introduce unhelpful noise whenever you do.
|
|
|
|
|
|
#17 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,228
Karma: 7640012
Join Date: Nov 2009
Device: many
|
And I can not recreate it in Sigil.
When I add and & #160; (without the space after the ampersand) to a nav entry and then tell it to generate an ncx, I get the following: Code:
<navPoint id="navPoint4">
<navLabel>
<text>Chapter 2: The Pool & #160; of Tears</text>
</navLabel>
<content src="Chapter-02.xhtml" />
</navPoint>
That is exactly correct. Then I replaced the nbsp in the nav with the actual nbsp char then recreated the ncx from it and ( if Preserve Entities has that nbsp included) you get the correct entity in the ncx. Next I replaced the nbsp in the nav with the actual nbsp char, then changed the Preserve Entities to *not* preserve the nbsp, and then recreated the ncx, it was generated with the correct nbsp character (no entity). So no bug here at all. This is working exactly as designed. Last edited by KevinH; 11-14-2026 at 02:58 PM. |
|
|
|
|
|
#18 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,950
Karma: 212736643
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Sounds good. I can't reproduce it either. So we'll assume that's the same thing the OP is seeing, and that Mobileread is just butchering what they pasted in (as usual).
|
|
|
|
|
|
#19 |
|
Member
![]() Posts: 15
Karma: 10
Join Date: Nov 2025
Device: none
|
Hi guys
I can reproduce the error with Sigil 2.8.6 on Windows 10. But you have to follow steps 1) to 4) exactly as described. It starts with image "01" in the NAV. Then after step 3) you get image "02" ... all is still OK. But after step 4) you get image "03". |
|
|
|
|
|
#20 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,950
Karma: 212736643
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I have confirmed this behavior on Linux. I DO have   in my preserve entities list.
|
|
|
|
|
|
#21 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,228
Karma: 7640012
Join Date: Nov 2009
Device: many
|
So something in SourceUpdates when updating links in the NCX or in the Nav is most probably generating that error. I will look into it. As NCX generation with correct Nav works just fine.
Last edited by KevinH; Yesterday at 09:31 AM. |
|
|
|
|
|
#22 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,950
Karma: 212736643
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It is not until step four that the entity in the ncx gets borked. Is the non-breaking space decimal entity not valid in the nav or ncx document? By my thinking, everything in the nav/ncx is valid when the final Restructure to Sigil Norm is run. But I could be wrong.
Last edited by DiapDealer; Yesterday at 10:44 AM. |
|
|
|
|
|
#23 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,228
Karma: 7640012
Join Date: Nov 2009
Device: many
|
In xml, numeric entities are always valid even without a special namespace added as is done in epub2 xhtml for named entities.
So it is something in SourceUpdates that updates links in the ncx or parses the ncx that is probably the issue. |
|
|
|
|
|
#24 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,950
Karma: 212736643
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm trying to nail it down to a shorter recreation process.
|
|
|
|
|
|
#25 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,228
Karma: 7640012
Join Date: Nov 2009
Device: many
|
https://github.com/Sigil-Ebook/Sigil...ement.py#L1341
I think the bug is in this routine as it does not handle other entities. So to test that. Start with an epub2 with ncx 1. Put numeric non-breaking space entity in one of the text fields of the ncx 2. Use Sigil BookBrowser Move to move the ncx to some other folder. That should run the SourceUpdates on that NCX that in turn parses the ncx with sigil_bs4 to update links, then decode it back to xml which hits the routine above. All of the above is a guess, all I have access to at the moment is an ipad. Last edited by KevinH; Yesterday at 01:25 PM. |
|
|
|
|
|
#26 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,228
Karma: 7640012
Join Date: Nov 2009
Device: many
|
I think that snippet of code was meant to disable all non-primary named entities, but it also hits valid numeric entities and disables them as well. Plus it did not exempt all 5 basic xml named entities.
So I have modified that code so that numeric entities are left alone as are the basic legal xml named entities such as quot, amp, apos, lt, and gt I have pushed this to Sigil master. The faster way to test this is: 1. open any epub2 and add & #160; (without the space after the &) in any text value entry or open any epub3 and edit the nav to add & #160; (without the space after the &) in any nav text entry and then delete and recreate the NCX using the epub3 tools 2. Right click in BookBrowser on the ncx and select Move to move it either up or down one directory level That is enough to cause SourceUpdates to be called on the ncx which in turn invokes sigil_bs4/elment.py in decodexml_contents which is what has the bug. This code stems from the epub2 only timeframe and changed the leading & of *named* entities which are illegal in pure xml like the ncx by converting the leading & to & amp; thereby disabling them. When epub3 came along and numeric entities became all the rage and named entities became illegal, we did not modify the code in sigil_bs4/element.py to properly allow numeric entities through untouched. I have just pushed the code to master to fix this. Thank you for the bug report. ps. Restructure to Sigil Norm simply was a complex way of invoking SourceUpdates on an ncx. Last edited by KevinH; Yesterday at 05:52 PM. |
|
|
|
|
|
#27 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,950
Karma: 212736643
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
|
|
|
|
|
#28 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,228
Karma: 7640012
Join Date: Nov 2009
Device: many
|
|
|
|
|
|
|
#29 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 55,854
Karma: 182814390
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
A build with this code added is now downloadable from the link in Downloading Sigil test builds for Windows.
|
|
|
|
|
|
#30 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 454
Karma: 100100
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
|
Frankly, I find the discussion of entity preservation puzzling. I've never understood what Sigil's Preserve Entities preference does and the User Guide doesn't help.
The User Guide mixes up the use of 'numerical entities', 'named entities' and 'Unicode characters' to the point where it is difficult to understand which to use. It is clear that epub3 prefers using numerical entities because xhtml cannot handle many of the named entities. The User Guide says: Code:
To preserve specific entities and prevent Mend from converting them to Unicode characters, click Add, and add them to the Entities to Preserve list. So, does having "& #160;" (without the space) in Sigil's preserve entities list mean that it will not be converted to a named entity? |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No Table of Contents and "This HTML file is larger than 260 KB" Error | rosewood | Conversion | 13 | 02-07-2023 12:58 PM |
| PRS-T3 "Table of contents" button on every page | Leon74 | Sony Reader | 2 | 01-04-2014 12:48 PM |
| Change name of autogenerated "Table of Contents" | Dzoni | Conversion | 7 | 03-16-2011 04:44 AM |
| Generating a rough "table of contents" | Vanguard3000 | Calibre | 5 | 01-09-2011 11:31 PM |
| TOO SLOW to open "Table of Contents" | mdhuang | Sony Reader | 16 | 09-06-2007 11:29 PM |