06-21-2024, 12:08 PM | #1 |
Enthusiast
Posts: 49
Karma: 10
Join Date: Jul 2023
Device: none
|
Preview window not quite in sync with code window.
Open test.epub in Sigil and click on TITLE in the preview window. On my machine (windows 11, Sigil 2.2.0), it highlights 'AUTHOR' in the code window. It is only this file, all other files seem to work properly. If I rename the file, it works, so I assume there is a non-printing character in the file name, but I don't know how to see it.
|
06-21-2024, 12:30 PM | #2 |
Guru
Posts: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
At the beginning of the file should be <?xml
In yours it is <?adxml Just remove the unnecessary "ad". |
06-21-2024, 01:36 PM | #3 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Does Sigil not offer to fix the malformed file?
|
06-21-2024, 01:50 PM | #4 |
Enthusiast
Posts: 49
Karma: 10
Join Date: Jul 2023
Device: none
|
|
06-21-2024, 01:54 PM | #5 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
I am confused, what does this have to do with Preview syncing to CodeView?
The xml headersare stripped off before passing it through gumbo as gumbo does not handle them. What about the simple sanity check? Did it detect the error? |
06-21-2024, 02:13 PM | #6 |
Bibliophagist
Posts: 40,549
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Neither the simple check nor epubcheck flag adxml as an error. OTOH, epubcheck complains about the line in content.opf "<item id="TYPEWRITER_IN_THE_SKY.html" href="TYPEWRITER_IN_THE_SKY.html" media-type="text/html"/>" which IIRC, should be 'media-type="application/xhtml+xml"'
Mend and prettify does change adxml to xml. If I change adxml to xml and the media type, the highlighting seems to work okay between preview and code view. I do wonder why the OP is using adXML? Last edited by DNSB; 06-21-2024 at 02:15 PM. |
06-21-2024, 02:24 PM | #7 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Okay, The <?adxml is technically an xml ? pi ("processing instruction") which is ignored in modern xhtml.
Sanity check does count the number of xml declarations and could easily be made to check that count and report any error. I will add that. |
06-21-2024, 02:59 PM | #8 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Okay, in my internal build of Sigil I now have sanitycheck.py making sure that the xml declaration header is there, that it comes before any doctype, html, body, etc.
I will add this to a future release. I just tested it against the op's test.epub and it does report a problem with that line. The xml header in the nav was just fine. I am just not sure if this will help much given how simple the SanityCheck (Well Formed EPUB) check is in Sigil compared to the much much more thorough epubcheck. This seems to be a rare type of failure. Last edited by KevinH; 06-21-2024 at 03:02 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Independent File Preview Window resizes when moving File Browser WIndow | GregTheGrate | Library Management | 4 | 12-12-2023 08:02 AM |
Delete Images in preview window / external script to customize code / shortcut | abraum | Editor | 4 | 11-02-2021 11:44 AM |
4.20 Code window and preview not syncing | JSWolf | Editor | 7 | 07-07-2020 06:44 PM |
Codeview & Preview window sync broken | Springbok | Sigil | 51 | 08-06-2019 10:12 PM |
Preview Window Zoom | GrannyGrump | Sigil | 16 | 06-16-2013 11:23 PM |