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
- A stylesheet whose { is never closed gets the missing } at its end. CSS already closes open blocks at the end of the file, so readers see nothing new. If the file ends inside a comment or a string, it is left alone.
- A background or list image that is not in the book becomes none. A reader draws an image that cannot load exactly as it draws none. If a file with the same name is elsewhere in the book, the path is probably just wrong, so it is left alone.
- A link written as http://name%40domain whose text is exactly name@domain becomes mailto:name@domain.
- In an EPUB 3 book, direction: ltr is removed from the CSS, because EPUB 3.3 does not allow the property there. It is kept if anything in the book could set another text direction (dir="auto", a bdi element, or a right-to-left page progression). An EPUB 2 book is not affected.
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