Google Play Books: EPUB fails on colons in id and href
Google Play Books can reject an EPUB at step 6 of 6 even when EPUBCheck reports no errors. The indexer stops when an HTML file has a colon in an id, or in the fragment of an href. Typical values are id="chap:…", id="sec:…", and links such as href="kapitel.xhtml#chap:…". In a book built with Pandoc from LaTeX they show up from the first chapter that uses those labels, often around ch006.xhtml. The same fragments are in nav.xhtml and in toc.ncx.
Cause
Pandoc copies LaTeX labels into the HTML attributes unchanged. \label{chap:einleitung} becomes id="chap:einleitung", and every reference to it becomes #chap:einleitung. EPUBCheck allows a colon in an ID. The Google Play Books indexer does not. The file looks valid, and the upload still stops at step 6.
The same trap exists in CSS. For such an ID Pandoc writes a selector like #chap\:glossary. The backslash before the colon is an error for the Google Play Books CSS parser. The rule is dropped. If that rule is what styles the glossary headings, the term titles disappear on the page, while the text is still in the file.
What has to change
Open the XHTML chapters, nav.xhtml, and toc.ncx. Replace every colon inside id="…" with a hyphen. Replace the colon only in the part after # in href and in src. https: and mailto: stay as they are, because the colon there belongs to the address scheme and not to the fragment.
id="chap:einleitung" and href="text/ch006.xhtml#chap:einleitung" become id="chap-einleitung" and href="text/ch006.xhtml#chap-einleitung". Every link must still point at the same ID. Changing only one side kills the jumps in the table of contents.
CSS selectors follow. #chap\:glossary becomes #chap-glossary. A plain h4 rule is also safe when the glossary terms are headings of that level.
Keep the glossary titles
The titles of the glossary terms are the text of the heading, not the ID. Changing id="chap:glossary" to id="chap-glossary" does not delete a term. Do not delete the headings to calm the indexer. After the change the titles must still be in the chapter, for example as an h4 whose content is the term.
Pack again and upload
Rebuild the EPUB with the same path that produced the file. If you close the archive by hand, mimetype stays the first file and stays uncompressed. Upload the new file on the Content tab of the book in Google Play Books. Processing then takes 24 to 48 hours.
LaTeX labels may keep their colons. Only the packed EPUB file that Google Play Books reads must have no colon left in id values and in link fragments.