|
I think special code to support ancient epub2 nook ereaders is really not something for Sigil.
I will look into the autocorrect for Sigil but the well-formed check is supposed to pick these types of errors up and explain the error.
That said, I have no desire to recreate or replace epubcheck inside Sigil. AFWIW, the check code you referred to only detects errors. There is no code to guess at an autocorrect. That must be someplace else in calibre's codebase, as it does not appear directly in the check folder (or at least I could not find it).
I did see comments that said the autocorrect is a guess and may not be what the user wants. My theory is for many of the structural errors, Kovid is autofixing using the equivalent of Sigil's gumbo Mend. Kovid's html repair parser borrows code from our gumbo. And Mend is always available as a right click pop-up menu in Sigil's CodeView.
Update
--------
At random I deleted one ending tag in 3 different files in a long epub. Then ran Sigil's Well-formed Check and it found and reported all 3. I could then either navigate to each and hand fix it or simply run Mend on the epub and it automatically fixed each case.
Lots of the checks in that "check" folder were for named entities (which Kovid got rid of even in epub2 because he did not want to support doctypes). These are automatically fixed by Mend as well.
There are checks for invalid id attributes not starting with an "alpha" character, and a few other more minor things.
If someone could provide a list of the most common errors they would like to have detected and auto "fixed", I will look into creating a new python based tools for that.
But nothing that would replace epubcheck. Epubcheck is the right tool in Sigil for detecting and reporting more complicated errors that running Mend will not fix.
For most common structural errors, using Sigil's Mend fixes things.
Last edited by KevinH; 01-11-2026 at 12:31 PM.
|