zestedesavoir / zmarkdown

Live demo: https://zestedesavoir.github.io/zmarkdown/
MIT License
224 stars 52 forks source link

Accessibility: confusion between caption and alternative text leads to badly accessible images #497

Open AmauryCarrade opened 9 months ago

AmauryCarrade commented 9 months ago

At the time of writing, when you place an image alone on its paragraph with alt text, such as :

![Image’s alternative text](https://github.com/zestedesavoir/zmarkdown/assets/1417570/700c7266-12f4-4604-8e5e-3cbed4c4e204)

...the image is displayed as a centred figure, with the alternative text displayed below the image as a caption. If you want to display a centred image like this without the so-called "caption", you need to place it in a central block, as follows:

-> ![Image’s alternative text](https://github.com/zestedesavoir/zmarkdown/assets/1417570/700c7266-12f4-4604-8e5e-3cbed4c4e204) <-

This is annoying, and more importantly, it misleads people as to what an alternative text really is. Alternative texts are not captions, they both have a completely different purpose. A text alternative is a precise and concise description of the image, useful for those who can't see it, whereas a caption is a complement to the image, for example by giving a context, adding sources and credits, etc.

This confusion frequently arises when new zmarkdown users ask why rich text cannot be included in the alt text of images: they think that the alt text is a caption. Alternative text is mainly meant to be spoken out loud, written on a Braille display, or read by a robot (search engine, etc.)—writing it as rich text doesn't make sense.

I suggest that:

StaloneLab commented 9 months ago

I think we already mentioned this subject somewhere; anyway, I agree on the problem: the way we currently handle alternative texts and captions is misleading. However, before changing this behavior, we need to think about what to do with the LaTeX, because we currently do not render the alternative text in LaTeX anywhere else than in the image caption, as far as I know (when no caption is given, otherwise it is not displayed at all).

Do you have an idea of what would be a good way to integrate this alternative text in LaTeX? Depending on what is chosen, implementation of ZMarkdown side could be more or less complicated, and we might also decide to update the template.

As a final thought, I shall note that this is a non-backward-compatible change, so might wait a bit before being released, even if changes are ready soon.