epubsana 0.43.0 is out: https://github.com/veripublica/epubs...es/tag/v0.43.0
Doitsu, the link and vlink case from your sample book is in this release. epubsana now removes link, vlink and alink from body when they colour nothing. That means the document has no link, or the book's own CSS already sets the colour of every link in the state the attribute is for: unvisited for link, visited for vlink, active for alink. calibre's pcalibre:link and pcalibre1:visited classes count, so the table of contents in your book qualifies too. On your sample, with every fix approved, the book now has no errors in epubveri or in epubcheck. The 25 warnings about spaces in file names stay, because renaming files is not something epubsana does.
When body has text, bgcolor or background, it is left alone. text="#000000" really does colour the text, so removing it would change what some readers show.
JSWolf, thanks for the wbr case. I have noted it, and I want to be sure what the one correct repair is before I build it. Removing the element loses a line break opportunity, and a zero-width space keeps the break but adds a character to the text. On the calibre plugin: I am working on it, and if nothing goes wrong it will be out today or tomorrow.
Other repairs in this release. None of them turned up in my own library. I found them in epub-test-books, a set of small books that each show one defect from the specification:
- A stylesheet or XML file that declares a legacy encoding such as windows-1252 or ISO-8859-1. If every byte is ASCII, only the label becomes UTF-8. Otherwise the file is converted to UTF-8, and epubsana asks first, showing the decoded words, so you can tell whether the declaration was right.
- A mimetype file with a trailing newline, a BOM, a leading space or capital letters, or one that is compressed.
- A fixed-layout viewport tag named Viewport, an NCX or container.xml without its version, a spine with no toc or the wrong toc, the manifest listing mimetype, the package document or a META-INF file, dcterms:modified ending in +00:00, and a language tag written en_US.
epubsana now uses epubveri 0.49.0, which reports alink, text, bgcolor and background on body as obsolete attributes, the same way as link and vlink.
The original file is never changed. epubsana writes the repaired book to a new file and lists every change it made. If a repair makes a book worse, please tell me here.
https://crates.io/crates/epubsana
https://www.npmjs.com/package/@verip.../epubsana-wasm