07-14-2024, 12:46 AM | #1 |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
A bug in Sigil?
Hi Kevin and Diap;
In my epubs (3), sometimes I add a javascript to the nav.xhtml file and when I do that, the property "scripted" is not added in the .opf file. That is not a big problem because I can add that property by hand (and I do that), but the issue arises when Sigil open the epub because the property added by me, is erased; I have to do the thing every time that Sigil opens the ebook. Could you fix that in the next Sigil version? Many thanks in advance. |
07-14-2024, 03:09 AM | #2 |
Bibliophagist
Posts: 40,626
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
If you use the ePub3 Tools item in the Tools menu and click on Update Manifest Properties, does this correct the error(s) for you. I haven't tried it with a js linked to the nav document, but it works for standard html documents though I seem to recall at one point, reading that what the navigation document can contain is limited and javascript was not listed as a allowed item. Now if I could find that reference...
Edit: The reference basically stated that since the navigation document is intended to be machine readable, javascript should not be used. Instead make the navigation document hidden and create an dedicated for human use html ToC. So perhaps a nav.xhtml navigation document and a toc.xhtml human intended ToC. Last edited by DNSB; 07-14-2024 at 03:21 AM. |
Advert | |
|
07-14-2024, 09:05 AM | #3 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
I will look into it. That property should not be erased if present on loading of any epub if it already exists in the opf manifest for any file.
|
07-14-2024, 05:08 PM | #4 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Yes the SetNavResource() in the OPFResouce is the issue as it just assigns the nav overwriting any other properties.
Also the Epub3 Update Manifest Properties Tool needs to be allowed to work on the nav. I will try to get a fix for both done soon. |
07-14-2024, 06:16 PM | #5 | |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
Advert | |
|
07-14-2024, 07:56 PM | #6 |
Bibliophagist
Posts: 40,626
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I'm not disagreeing that allowing the scripted property for the nav document is not prohibited. What I got from the article I read and made a couple of notes from is that the authors did not recommend using javascript in the nav document since it could cause issues with the renderer's ability to parse the file. Their suggested workaround was a vanilla navigation document that was hidden and a ToC file that could be fancified without needing to worry about the renderer parsing it.
|
07-15-2024, 01:18 AM | #7 | |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Last edited by RbnJrg; 07-15-2024 at 01:22 AM. |
|
07-15-2024, 01:40 PM | #8 | |
Bibliophagist
Posts: 40,626
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
|
|
07-15-2024, 05:40 PM | #9 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
This should now be fixed in master.
Thank you for your bug report! |
07-16-2024, 12:40 AM | #10 |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A new bug in Sigil 0.9.12? | RbnJrg | Sigil | 6 | 03-07-2019 08:20 AM |
Bug in Sigil 0.9.5 | PKTC | Sigil | 6 | 04-05-2016 01:33 PM |
Possible Bug in Sigil 0.8.7 | dragon reader | Sigil | 34 | 11-19-2015 12:45 PM |
possible h1 bug in Sigil 0.6.1? | michaelbr | Sigil | 2 | 12-04-2012 08:56 PM |