Epubs built by PreText yields errors when submitted to Google Books

30 views
Skip to first unread message

Humanities Clinic

unread,
Apr 28, 2026, 7:45:26 AM (11 days ago) Apr 28
to PreTeXt support

Despite the build to epub yielding 0 errors, and the output epub passing epubcheck with 0 errors as well, I get these errors when I submit the epub to Google Books:
EPUB/css/epub.css:1004, 20: An error occurred while parsing the CSS: Token ".code-display" not allowed here.

EPUB/css/epub.css:1004, 20: An error occurred while parsing the CSS: Token ".code-display" not allowed here.

EPUB/css/epub.css:1007, 20: An error occurred while parsing the CSS: Token ".code-display" not allowed here.

EPUB/css/epub.css:1007, 20: An error occurred while parsing the CSS: Token ".code-display" not allowed here.

EPUB/css/epub.css:1379, 18: An error occurred while parsing the CSS: Token ".autopermalink" not allowed here.

EPUB/css/epub.css:1379, 18: An error occurred while parsing the CSS: Token ".autopermalink" not allowed here.

EPUB/css/epub.css:1382, 18: An error occurred while parsing the CSS: Token ".autopermalink" not allowed here.

EPUB/css/epub.css:1382, 18: An error occurred while parsing the CSS: Token ".autopermalink" not allowed here.

EPUB/css/epub.css:1385, 20: An error occurred while parsing the CSS: Token "a" not allowed here.

EPUB/css/epub.css:1385, 20: An error occurred while parsing the CSS: Token "a" not allowed here.

May I know why is this so, and how to solve?


Rob Beezer

unread,
Apr 28, 2026, 8:47:46 AM (11 days ago) Apr 28
to pretext...@googlegroups.com
First, those are not your "fault", so thanks very much for reporting them.

Second, those look like errors from the EPUB validator known as "epubcheck". I wonder if we can determine which version Google Books is using? Moving to a more recent version recently resolved a lot of errors we had been seeing.

Third, I think "autopermalink" can be fixed easily, while "codedisplay" could be more essential.

Finally, are these errors preventing you from viewing the EPUB output via Google Books?

Rob

Andrew Scholer

unread,
Apr 28, 2026, 11:16:21 AM (11 days ago) Apr 28
to pretext...@googlegroups.com
The CSS rules on those lines all use :has() in selectors. EPUB check prior to 5.3 (Sept 2025 release) was incorrectly flagging that as invalid.
https://github.com/w3c/epubcheck/issues/1605

The relevant rules should have no effect on EPUB. The ".code-display" items are related to the "copy code" button. All the others (including "a") are permalink related. It might be nice to factor them out of the EPUB css build, but they will not be used to style anything in that format.

Andrew

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/MTAwMDAwMy5iZWV6ZXI.1777380463%40pnsh.

Humanities Clinic

unread,
Apr 28, 2026, 12:03:40 PM (11 days ago) Apr 28
to PreTeXt support
Dear Mr Rob and Andrew, 
Answer to: "Finally, are these errors preventing you from viewing the EPUB output via Google Books?"
Yes! I was trying to submit the book so that it can be seen by the public on Google Books and Google Play, and the system is not allowing me to continue because of this error.

So is there a way to solve it? According to Andrew, one should just ignore it, is that correct?
But Google Books and Google Play won't accept my submission...

Andrew Scholer

unread,
Apr 28, 2026, 6:20:02 PM (10 days ago) Apr 28
to pretext...@googlegroups.com
We can try to trim the offending CSS out of the EPUB build, which would solve your immediate issue.

But I just confirmed that epubcheck 5.3 has no issues with the CSS. So the real failure here is that the automatic checks for Google Books apparently are using an out of date version of epubcheck. I would suggest you raise an issue with them. It is entirely possible some future addition to the CSS that is required for proper rending of the contents in an epub will set off the same out of date check utility.

Andrew

Rob Beezer

unread,
Apr 29, 2026, 9:44:36 AM (10 days ago) Apr 29
to pretext...@googlegroups.com
Thanks, Andrew, for the great work on this one, including the PR.

I agree that this is an issue for Google, long-term. Not sure if anybody in the PreTeXt community has any personal contacts that might help move that along.

Humanities Clinic - when you make an issue at Google, could you post a link here so we can monitor it? Thanks again for making us aware of this one!

Rob
>> https://groups.google.com/d/msgid/pretext-support/4f9108bd-2b11-429f-886d-64918c318d89n%40googlegroups.com
>> <https://groups.google.com/d/msgid/pretext-support/4f9108bd-2b11-429f-886d-64918c318d89n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
Reply all
Reply to author
Forward
0 new messages