Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#37456 closed Cleanup/optimization (fixed)

Docs: contribution_process.svg fails epub validation

Reported by: Mike Edmunds Owned by: Natalia Bidart
Component: Documentation Version: dev
Severity: Release blocker Keywords: epub
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The contribution_process.svg image causes an ​EPUBCheck error RSC-005 in the docs epub build, due to prohibited <font> tags inside foreignObjects.

This will likely prevent that image from appearing correctly in some eReaders. (Though it shouldn't prevent the epub as a whole from rendering.)

Also, a large part of that svg file is some ~20KB of draw.io original editable source, serialized into in a nonstandard content attribute. It might be helpful to keep the editable source file separate from optimized, compliant output for web/epub use.

(​PR #22198 includes a commit that could add EPUBCheck to our regular documentation testing, pending resolution of this issue. The NAV-011 warnings are probably ignorable.)

% cd docs
% make epub
% epubcheck _build/epub/Django.epub 
Validating using EPUB version 3.4 rules.
ERROR(RSC-005): _build/epub/Django.epub/_images/contribution_process.svg(4,36744): Error while parsing file: element "font" not allowed here; expected the element end-tag, text, element "ns1:switch", "ns1:trigger", "ns2:math", "ns3:a", "ns3:abbr", "ns3:address", "ns3:area", "ns3:article", "ns3:aside", "ns3:audio", "ns3:b", "ns3:bdi", "ns3:bdo", "ns3:blockquote", "ns3:br", "ns3:button", "ns3:canvas", "ns3:cite", "ns3:code", "ns3:data", "ns3:datalist", "ns3:del", "ns3:details", "ns3:dfn", "ns3:dialog", "ns3:div", "ns3:dl", "ns3:em", "ns3:embed", "ns3:fieldset", "ns3:figure", "ns3:footer", "ns3:form", "ns3:h1", "ns3:h2", "ns3:h3", "ns3:h4", "ns3:h5", "ns3:h6", "ns3:header", "ns3:hgroup", "ns3:hr", "ns3:i", "ns3:iframe", "ns3:img", "ns3:input", "ns3:ins", "ns3:kbd", "ns3:label", "ns3:link", "ns3:main", "ns3:map", "ns3:mark", "ns3:menu", "ns3:meta", "ns3:meter", "ns3:nav", "ns3:object", "ns3:ol", "ns3:output", "ns3:p", "ns3:picture", "ns3:pre", "ns3:progress", "ns3:q", "ns3:ruby", "ns3:s", "ns3:samp", "ns3:script", "ns3:search", "ns3:section", "ns3:select", "ns3:selectedcontent", "ns3:slot", "ns3:small", "ns3:span", "ns3:strong", "ns3:sub", "ns3:sup", "ns3:table", "ns3:template", "ns3:textarea", "ns3:time", "ns3:u", "ns3:ul", "ns3:var", "ns3:video", "ns3:wbr" or "svg" (with xmlns:ns1="http://www.idpf.org/2007/ops" xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns3="http://www.w3.org/1999/xhtml") or an element from another namespace
WARNING(NAV-011): _build/epub/Django.epub/nav.xhtml(462,81): "toc" nav must be in reading order; link target "topics/class-based-views/index.xhtml#basic-examples" is before the previous link’s target in spine order.
WARNING(NAV-011): _build/epub/Django.epub/nav.xhtml(922,64): "toc" nav must be in reading order; link target "howto/index.xhtml#templates-and-output" is before the previous link’s target in spine order.
WARNING(NAV-011): _build/epub/Django.epub/nav.xhtml(942,80): "toc" nav must be in reading order; link target "howto/index.xhtml#project-configuration-and-management" is before the previous link’s target in spine order.
WARNING(NAV-011): _build/epub/Django.epub/nav.xhtml(959,78): "toc" nav must be in reading order; link target "howto/index.xhtml#installing-deploying-and-upgrading" is before the previous link’s target in spine order.
WARNING(NAV-011): _build/epub/Django.epub/nav.xhtml(976,56): "toc" nav must be in reading order; link target "howto/index.xhtml#other-guides" is before the previous link’s target in spine order.
WARNING(NAV-011): _build/epub/Django.epub/nav.xhtml(1269,77): "toc" nav must be in reading order; link target "ref/class-based-views/index.xhtml#specification" is before the previous link’s target in spine order.
WARNING(NAV-011): _build/epub/Django.epub/nav.xhtml(1336,59): "toc" nav must be in reading order; link target "ref/contrib/index.xhtml#admin" is before the previous link’s target in spine order.

Check finished with errors
Messages: 0 fatals / 1 error / 7 warnings / 0 infos

If you don't want to install epubcheck through your package manager, it's also on PyPI:

% python -m pip install epubcheck
% python -m epubcheck _build/epub/Django.epub 

Change History (7)

comment:1 by Natalia Bidart, 3 weeks ago

Triage Stage: Unreviewed → Accepted
Type: Uncategorized → Cleanup/optimization

Thank you Mike, I reproduced the error using an online epub checker (local epubcheck would fail on lack on java runtime).

comment:2 by Natalia Bidart, 3 weeks ago

Severity: Normal → Release blocker

After some git history checks, I'll mark this as a release blocker and fix myself. Regression in eaf7b563a5d3861026242fdb503a58f71acf17f6.

comment:3 by Natalia Bidart, 3 weeks ago

Owner: set to Natalia Bidart
Status: new → assigned

comment:4 by Natalia Bidart, 3 weeks ago

Has patch: set

comment:5 by Mike Edmunds, 3 weeks ago

Triage Stage: Accepted → Ready for checkin

comment:6 by nessita <124304+nessita@…>, 3 weeks ago

Resolution: → fixed
Status: assigned → closed

In e9cf067:

Fixed #37456 -- Converted contribution process diagram to plain SVG.

The draw.io export used HTML labels inside foreignObject elements,
including a <font> element, which made the epub build fail EPUBCheck
validation. It also embedded about 20KB of draw.io source, and its
light-dark() colors could not be edited in SVG editors like Inkscape.

Labels are now SVG text elements, light colors are presentation
attributes, and dark mode is a prefers-color-scheme media query. In
dark mode, arrows keep the color of the role making each transition,
matching the legend.

Thanks Mike Edmunds for the report.

Regression in eaf7b563a5d3861026242fdb503a58f71acf17f6.

comment:7 by Natalia <124304+nessita@…>, 3 weeks ago

In 5e109ba:

[6.1.x] Fixed #37456 -- Converted contribution process diagram to plain SVG.

The draw.io export used HTML labels inside foreignObject elements,
including a <font> element, which made the epub build fail EPUBCheck
validation. It also embedded about 20KB of draw.io source, and its
light-dark() colors could not be edited in SVG editors like Inkscape.

Labels are now SVG text elements, light colors are presentation
attributes, and dark mode is a prefers-color-scheme media query. In
dark mode, arrows keep the color of the role making each transition,
matching the legend.

Thanks Mike Edmunds for the report.

Regression in eaf7b563a5d3861026242fdb503a58f71acf17f6.

Backport of e9cf067c614fd08f2ba1d216edf213c6ff806554 from main.

Note: See TracTickets for help on using tickets.
Back to Top