|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#61 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 290
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
epubsana 0.30.0 is out today. It also brings 0.29.0, from earlier today, which I did not post about separately.
https://github.com/veripublica/epubs...es/tag/v0.30.0 As before: your original file is never modified, and the repaired copy is written beside it. Every fix is shown to you before it is made, and the run ends with a report of exactly what changed. The browser version needs no install and uploads nothing: https://veripublica.github.io/epubsana/ Most of what is new came from books that epublift had upgraded from EPUB 2 to EPUB 3. Each one is also a defect a book can carry without any upgrade. Named characters that stopped a file from opening A file that uses a named character such as emsp, thinsp, rarr or a Greek letter, without a DTD that declares it, cannot be read by a reading system that reads the file as XML. epubsana replaced these names with the characters they stand for, but it only knew 117 of them. It now knows every name the XHTML 1.x DTDs declare, so the em space and its relatives are repaired too. A name outside that set is still left alone. Files declared as HTML Some books declare a chapter as text/html in the manifest when the file is really XHTML. In EPUB 2 that is a warning. In EPUB 3 it is an error, and the chapter is in the reading order with nothing to fall back on. epubsana now declares such a file application/xhtml+xml, but only after checking that the file reads as XML with an XHTML html root. A file that is real HTML is left alone, because it needs converting, not relabelling. The file itself is not changed. One thing to expect: the report can end with more errors than it started with. epubveri never fully checks a file declared text/html. In EPUB 3 it does not open the file at all, and in EPUB 2 it does not check the file's ids. Once the declaration is right, the file is checked for the first time, and whatever was wrong in it all along shows up. epubsana says so at the end of the run. Run it again on the repaired copy to repair what it can; for example, an empty title it found in a chapter it could not read before. A script that points at nothing Some books carry a script element whose file is not in the book. In my library it is always Kobo's kobo.js. epubsana now offers to delete the element, and to remove the scripted declaration from the manifest if nothing else in the file needs it. It asks first, and here is why: I do not know whether a Kobo device supplies its own kobo.js to a book that names it. If you know, I would like to hear it. A script element with code inside, or one whose file is in the book under another path, is left alone. Smaller repairs
For plugin authors New fix_ids: fix.content_url_spaces (AutoSafe, so --auto-safe applies it), fix.html_media_type and fix.missing_script (both ConfirmNeeded, so they are always asked). The EPUB 3 anchor and Dublin Core repairs keep their old fix_ids, fix.nested_anchor and fix.empty_metadata_element. For anyone using the Rust crate directly: entities::TABLE is gone, and entities::lookup now returns a char. The ask Same as always. epubsana checks its own repairs with epubveri, so it cannot see damage epubveri cannot see. If a repair leaves one of your books worse, please tell me here. The same goes for a book that is still reported valid when epubcheck disagrees. Command-line binaries for Windows, macOS and Linux are on the releases page. https://crates.io/crates/epubsana https://www.npmjs.com/package/@verip.../epubsana-wasm |
|
|
|
|
|
#62 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,741
Karma: 154365285
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
https://www.cross-plus-a.com/btext.htm TTS Reader by Librera (Android) EPUBReader + Read Aloud (for Chrome/Edge/Firefox) Thorium Reader (Windows) |
|
|
|
|
|
|
#63 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 290
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
epubsana 0.34.0 is out. It also brings 0.31.0 to 0.33.0, which I did not post about separately.
https://github.com/veripublica/epubs...es/tag/v0.34.0 As before: your original file is never modified, and the repaired copy is written beside it. Every fix is shown to you before it is made, and the run ends with a report of exactly what changed. The browser version needs no install and uploads nothing: https://veripublica.github.io/epubsana/ The two new repairs were suggested by epublift, from what was left in books it had upgraded to EPUB 3. They tested this release on those books before it went out. A nested list sitting directly in its parent list Many converters write a nested table of contents like this: an item, then the sub-list right after it, outside the item. A list may hold only list items, so this is an error. epubsana now moves the sub-list into the item before it. It does this by moving that item's own end tag past the sub-list, so nothing is added or deleted. The question is whether the book looks the same afterwards, so epubsana does not assume it. It matches every selector of the book's stylesheets, and of the chapter's own style element, against the chapter before and after the move. If one selector would style any element differently (li > ul, or li:last-child, for example), or cannot be decided without a reader (:hover), the chapter is left alone. So is a sub-list with no item before it, or with text or a comment in between. An image declared as the wrong image type Some books declare a PNG as image/jpeg in the manifest, or the other way round. A reading system shows what the file holds, so the declaration is what is wrong. epubsana now declares the type the file holds, for JPEG, PNG and GIF. The file and its name are not changed. A file of a type that is not a core image type in both EPUB versions (TIFF, BMP, WebP) needs converting, not relabelling, and is left alone. Fixed: a link to a renamed id When epubsana renames an invalid id, it also rewrites the links that point at it. A link that spelled the id with percent escapes, such as #k10%20 for an id of "k10 " with a trailing space, was missed, so it kept pointing at the old id and the book kept one error. Every escaped spelling of the id is now found and rewritten. An id that itself contains a % sign is left alone. From 0.31.0 to 0.33.0
For plugin authors New fix_ids: fix.nested_list_in_list and fix.image_media_type, both ConfirmNeeded, so they are always asked. For the npm package (since 0.31.0): the types are unchanged, but the glue's import functions were renamed, so a hand-written loader that builds its import object by name must follow. A loader that passes the glue module whole needs no change. Titles and read-aloud Thanks to JSWolf for the list of read-aloud programs that read a chapter's title (#62). I have not tested them yet, and I will report here when I have. Until then nothing changes: epubsana only fills a title that is empty, from the table of contents entry, then the first heading, then the book's title. It never replaces one that is already there. The ask Same as always. epubsana checks its own repairs with epubveri, so it cannot see damage epubveri cannot see. If a repair leaves one of your books worse, or looks different in your reader, please tell me here. Command-line binaries for Windows, macOS and Linux are on the releases page. https://crates.io/crates/epubsana https://www.npmjs.com/package/@verip.../epubsana-wasm |
|
|
|
|
|
#64 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 290
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
epubsana 0.40.0 is out. It also brings 0.35.0 to 0.39.0, which I did not post about separately.
https://github.com/veripublica/epubs...es/tag/v0.40.0 As before: your original file is never modified, and the repaired copy is written beside it. Every fix is shown to you before it is made, and the run ends with a report of exactly what changed. The browser version needs no install and uploads nothing: https://veripublica.github.io/epubsana/ A file nothing touched comes back as it was Since 0.36.0, epubsana writes the EPUB container itself. A file inside the book that no fix changed is copied byte for byte, with its zip headers, in the same order. Before, every file was re-packed, and some zip header details were lost even when no fix had touched it. I checked this on every book in my library: written with no fix applied, each one came back byte-identical. Four new repairs
All four are always asked, never applied without you. The verdict now follows the EPUB specification epubsana checks books with epubveri, and since epubveri 0.38.0 its verdict follows the EPUB specification, not epubcheck. 0.40.0 moves to it. So a book epubcheck accepts can now be reported invalid, and a repaired book can keep errors it did not show before. In my library these are images without an alt attribute, resources with no fallback, and manifest items written outside the package's namespace, which a calibre conversion can leave behind. epubsana itself did not change: in my library, every proposed fix and every repaired file is the same as in 0.39.0. Only the report is stricter. If a book that used to come out valid now does not, that is why. Your book did not get worse. Safety 0.36.0 and 0.38.0 moved to newer versions of the zip library, which fix problems in reading damaged archives. If you use an older epubsana on files you did not make yourself, please update. For plugin authors New fix_ids, all ConfirmNeeded: fix.css_unterminated, fix.css_missing_image, fix.email_as_http_url and fix.css_direction_ltr. 0.40.0 is a minor because epubveri's types are part of the API. Nothing in epubsana's own types changed. The ask Same as always. epubsana checks its own repairs with epubveri, so it cannot see damage epubveri cannot see. If a repair leaves one of your books worse, or looks different in your reader, please tell me here. Command-line binaries for Windows, macOS and Linux are on the releases page. https://crates.io/crates/epubsana https://www.npmjs.com/package/@verip.../epubsana-wasm |
|
|
|
|
|
#65 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,941
Karma: 24259515
Join Date: Dec 2010
Device: Kindle PW2
|
I have a couple of suggestions for updating old epub2 files that were most likely generated by converting MS Word .doc/.html files with older Calibre versions. (Calibre converts .docx files just fine.)
These files often contain the following code: Code:
<br clear="all" class="calibre5" id="calibre_pb_0"/> <body lang="EN-US" link="blue" vlink="purple" class="calibre"> Here's an MR epub2 book that contains these attributes. |
|
|
|
|
|
#66 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 290
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
Thanks, Doitsu, and thanks for the sample book. I have noted both cases, the empty br with clear and the link and vlink attributes on body.
Right now I am working through the EPUB specifications and turning their rules into test books. When that is done, I will have time for epubveri and epubsana again, and these will be on the list. I want to do it in that order because knowing the rules comes first. If I don't know exactly what the specification says, I can't tell where a book is wrong, and I can't tell what the one correct repair is. So I'm asking for a little time. |
|
|
|
|
|
#67 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 290
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
epubsana 0.42.0 is out. It also brings 0.41.0, which I did not post about separately.
https://github.com/veripublica/epubs...es/tag/v0.42.0 Doitsu, your br clear="all" case is in this release. Thank you for the sample book, it is what I built and tested this against. epubsana now removes clear from a br, but only when nothing in the book can float. clear only says where a line goes relative to floating boxes. An EPUB 2 reader ignores the attribute, because XHTML 1.1 does not have it, and a browser-based reader applies it. When there is no float, both draw the same page, so removing it changes nothing a reader sees. If anything in the book could float (a float in any stylesheet or style attribute, an image or table aligned left or right, an @import, or a stylesheet outside the book), the book is left alone, because then the two readings differ and I can't know which one the author saw. On your sample, all 24 are removed. The fix is always asked, never applied without you. The link and vlink attributes on body are not in this release. They can only go when the book's own CSS already sets the colour of every link, visited or not, as calibre's .pcalibre rules do in your sample. Checking that properly means working out which rule wins for each link, and I have not built that yet. It is next on my list. Two smaller things since 0.40.0, from epubveri: in an EPUB 3 book a CSS syntax error is now reported as usage rather than an error, and a valid EPUB 2 ops:switch is no longer reported as an error. As before: your original file is never modified, and the repaired copy is written beside it. The browser version needs no install and uploads nothing: https://veripublica.github.io/epubsana/ For plugin authors: one new fix_id, fix.br_clear_without_float (ConfirmNeeded). 0.41.0 and 0.42.0 are minors because epubveri's types are part of the API. Nothing in epubsana's own types changed. If a repair leaves one of your books worse, or looks different in your reader, please tell me here. https://crates.io/crates/epubsana https://www.npmjs.com/package/@verip.../epubsana-wasm |
|
|
|
|
|
#68 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,741
Karma: 154365285
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Is there going to b a plugin for epubsana for calibre's editor?
|
|
|
|
|
|
#69 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,741
Karma: 154365285
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I've found something for epubsansa to remove.
Code:
ERROR OEBPS/xhtml/copyright.xhtml 11 55 RSC-005: element "wbr" is not allowed here ERROR OEBPS/xhtml/copyright.xhtml 11 71 RSC-005: element "wbr" is not allowed here |
|
|
|
![]() |
| Tags |
| epub, epub2, epub3, epubsana, epubveri |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Editor Plugin] EpubCheck | Doitsu | Plugins | 252 | Yesterday 07:35 AM |
| squashed images in Editor/Tools/Reports after search | rjwse@aol.com | Calibre | 1 | 12-18-2019 01:00 PM |
| Possible bug in editor (reports) | ratanplan | Editor | 2 | 02-18-2015 07:22 AM |
| Reports of 3.1 being pushed out for automatic upgrade | Tiersten | Amazon Kindle | 33 | 02-20-2011 11:37 AM |
| Web-based epubcheck upgraded to epubcheck 1.0.5 | kjk | ePub | 4 | 02-09-2010 10:53 PM |