Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation error with epubcheck #1376

Closed
shimizukawa opened this issue Jan 3, 2015 · 6 comments
Closed

Validation error with epubcheck #1376

shimizukawa opened this issue Jan 3, 2015 · 6 comments

Comments

@shimizukawa
Copy link
Member

If you insert an image like this:

#!rst

.. image:: images/Eye_of_Horus.*
      :width: 20%
      :align: center

You get this html:

#!html

<a class="reference internal image-reference" href="_images/Eye_of_Horus.svg"><div align="center" class="align-center"><img src="_images/Eye_of_Horus.svg" width="20&#37;" /></div>
</a>

Which does not validate against epubcheck:

#!bash

Validating against EPUB version 2.0
ERROR: /home/juh/Projekte/Literatur/sphinx-handbuch/_build/epub/Sphinx.epub/abbildungen.html(60,120): element "div" not allowed here; expected the element end-tag, text or element "a", "abbr", "acronym", "applet", "b", "bdo", "big", "br", "cite", "code", "del", "dfn", "em", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "tt" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")
ERROR: /home/juh/Projekte/Literatur/sphinx-handbuch/_build/epub/Sphinx.epub/abbildungen.html(60,120): attribute "align" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: /home/juh/Projekte/Literatur/sphinx-handbuch/_build/epub/Sphinx.epub/abbildungen.html(60,170): element "img" missing required attribute "alt"
ERROR: /home/juh/Projekte/Literatur/sphinx-handbuch/_build/epub/Sphinx.epub/abbildungen.html(102,129): element "img" missing required attribute "alt"
ERROR: /home/juh/Projekte/Literatur/sphinx-handbuch/_build/epub/Sphinx.epub/_images/Eye_of_Horus.svg(3,132): value of attribute "version" is invalid; must be equal to "1.1"
ERROR: /home/juh/Projekte/Literatur/sphinx-handbuch/_build/epub/Sphinx.epub/abbildungen.html(60,79): hyperlink to non-standard resource '_images/Eye_of_Horus.svg' of type 'image/svg+xml'
WARNING: /home/juh/Projekte/Literatur/sphinx-handbuch/_build/epub/Sphinx.epub/abbildungen.html(60,79): hyperlink to resource outside spine '_images/Eye_of_Horus.svg'


@shimizukawa shimizukawa added this to the 1.2.x milestone Jan 3, 2015
@juh2
Copy link
Contributor

juh2 commented Feb 18, 2015

This is a severe bug, as Google Play does not accept the epub.

@juh2
Copy link
Contributor

juh2 commented Mar 14, 2015

Please check epub converted with Sphinx 1.3 There are a lot of errors.

@shimizukawa
Copy link
Member Author

In fact, sphinx can't generate XHTML. For now, it's a limitation.

In near future, docutils supports XHTML writer, after that we can improve our epub bulider.
https://groups.google.com/d/msg/sphinx-dev/qeaq7RV8ccw/AlCa7k4cgDcJ

@shimizukawa shimizukawa removed this from the 1.2.x milestone Jul 10, 2015
@mgifford
Copy link

mgifford commented May 6, 2016

Not sure if we should close this issue and move to this other one:
#2371

@shibukawa
Copy link
Contributor

#3464 fix almost all errors except the following ones:

ERROR (RSC-005) at "a.epub/index.xhtml" (line 21, col 42):
   Error while parsing file 'attribute "align" not allowed here

ERROR (RSC-005) at "a.epub/index.xhtml" (line 21, col 107):
   Error while parsing file 'value of attribute 'width' is invalid; must be an integer'.

@shibukawa
Copy link
Contributor

I confirmed current master branch (#3464) fix this issue. This fix will be released with 1.6.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants