Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
2.5
-
None
-
Unknown
-
Description
Steps to reproduce
- Create a page with a PlantUML macro that outputs a PNG, for example:
{{plantuml}} Alice -> Bob : hello {{/plantuml}} - View the page and inspect the generated image.
Actual result
The image has its own URL as alternative text:
<img src="/xwiki/tmp/plantuml/document%3Axwiki%3ASandbox.WebHome/1932342732.png" alt="/xwiki/tmp/plantuml/document%3Axwiki%3ASandbox.WebHome/1932342732.png"/>
Screen reader users hear an encoded temporary file path instead of what the diagram shows, which fails WCAG 2.2 success criterion 1.1.1 Non-text Content (level A). The macro has no parameter to provide a text alternative: its title parameter is drawn inside the image and never reaches the HTML.
This happens on xwiki.org, for example in the diagram of the accessibility statement.
Expected result
The macro has an alt parameter, whose value becomes the alt attribute of the generated image.
Technical details
DefaultPlantUMLRenderer#renderImageBlock returns new ImageBlock(resourceReference, false) without any parameter, so the XHTML renderer falls back to the image URL for the alt attribute. Passing an alt parameter to the ImageBlock when it is set would fix the PNG output.
Open questions:
- When alt is not set, should the title parameter be used as a fallback? It is shorter than a full description, but much better than the URL.
- The SVG output is inlined as raw HTML, so it would need role="img" and an aria-label (or a <title> element) on the <svg> instead of an alt attribute.