View Single Post
Old 08-12-2024, 03:28 PM   #52
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 876
Karma: 3501146
Join Date: Jan 2017
Location: Poland
Device: Various
Theoretically, yes.
However, I recognize this code because it reminds me of your code from the TOCSaver plugin.
There, too, there is a problem (only in epub2) that epubcheck considers the hidden attribute invalid.

Code:
Col: 53: ERROR(RSC-005): Error while parsing file: attribute "hidden" not allowed here; expected attribute "class", "dir", "lang", "title" or "xml:lang"
So I would suggest something along these lines:
Code:
            QString version = sink_resource->GetEpubVersion();
            if (version.startsWith("3")) {
                new_bodies.append("  <p id=\"" + section_id + "\" style=\"display:none\" hidden=\"hidden\"></p>\n" + updated_bodies[bookpath]);
            } else {
                new_bodies.append("  <p id=\"" + section_id + "\" style=\"display:none\"></p>\n" + updated_bodies[bookpath]);
            }
I built Sigil just now and it passes epubcheck for epub2 and epub3.


I know your approach to epub2, however, in Poland at least 80-90% of new titles in bookstores are still epub2. The volume of epub3 files is gradually increasing, but this is happening extremely slowly.

P.S. In the modified TOCSaver plugin I use a similar condition (in three places in the code) and it works very well.

Last edited by BeckyEbook; 08-12-2024 at 03:34 PM.
BeckyEbook is offline   Reply With Quote