EPub from ebook-convert is accepted by Amazon KDP, but not Google Play

Bug #1922570 reported by Michael Schmidt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

I like to publish an ebook created by ebook-convert (4.23.0 on Ubuntu 20.4) on Google PlayStore and their epub validator returns

Error while parsing file: attribute "class" not allowed here; expected attribute "dir", "lang", "version" or "xml:lang".

for every chapter. I found out removing class attribute from the html tag solves the problem.

<html xmlns="http://www.w3.org/1999/xhtml" class="calibre">

At https://bugs.launchpad.net/calibre/+bug/1897582 I learnt that it might have to do with a css attribute that is clinged to the html element. But I don't find any style information, that I set on the html element. I just pass in a markdown file with additional CSS set, but this contains nothing for the html tag. And if I omit it, I get the same error.

Is is possible to tell ebook-convert not to add the class somehow?

My full command I send is:

ebook-convert /tmp/ebookmaker_tmpfile.epub.md path/to/book.epub --language "de" --title "Booktitle" --authors "Author" --output-profile "kindle" --book-producer "ewer" --comments "MIT" --isbn "9798683069964" --pubdate "<DATE>" --publisher "Michael Schmidt" --extra-css "[path to]/media/global.css" --embed-all-fonts --line-height "22" --change-justification "justify" --formatting-type "markdown" --toc-title "Inhalt" --level1-toc "//h:h2" --use-auto-toc

Revision history for this message
Michael Schmidt (lafrisrap) wrote :
Revision history for this message
Michael Schmidt (lafrisrap) wrote :

The validator that returns the error message is also online here: http://validator.idpf.org/

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1922570

Dont set any css that applies to the html tag and there wont be a class
attribute on it. Remove your global.css.

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Michael Schmidt (lafrisrap) wrote :

I don't set any CSS other than in the attached file. And there is no reference to the html tag. I use the ebook-convert command like I showed above. There is one global css file, nothing more.

Revision history for this message
Kovid Goyal (kovid) wrote :

Attach a complete example demonstrating/reproducing the problem to this bug report. You can do that by clicking the "Add attachment or patch" link at the bottom of the bug's page. If the file you are attaching is copyrighted, mark the bug as private. You can do this by clicking the tiny yellow icon next to "This report contains Public information" in the top right area of the bug's page.

 status incomplete

Changed in calibre:
status: Invalid → Incomplete
Revision history for this message
Michael Schmidt (lafrisrap) wrote :

I narrow it down:

ebook-convert test.md test.epub

with the attached test.md file works.

ebook-convert test.md test.epub --line-height "22"

leads to the described error, when uploading the test.epub file to http://validator.idpf.org/

I also attached the screenshots of the test runs:

Revision history for this message
Michael Schmidt (lafrisrap) wrote :

Test result after ebook-convert test.md test.epub --line-height "22"

Revision history for this message
Michael Schmidt (lafrisrap) wrote :

Testrun of ebook-convert test.md test.epub --line-height "22"

Revision history for this message
Michael Schmidt (lafrisrap) wrote :

Test result after ebook-convert test.md test.epub

Revision history for this message
Michael Schmidt (lafrisrap) wrote :

Testrun of ebook-convert test.md test.epub

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Incomplete → Fix Released
Revision history for this message
Michael Schmidt (lafrisrap) wrote :

Thanks a lot! You are so fast ...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.