I came looking for a way to add a caption—visible to all—to an image. (<figcaption>)
alt vs. caption
I love that Discourse supports alt text for sight-impaired readers, but they’re effectively unavailable to sighted readers. Sighted readers don’t neccessarily need the same full image description, but would often be served by a bit of context, e.g. What movie is that screenshot from? What’s the title of that artwork?
The search was complicated a bit by the fact that “caption” is often used here when discussing image alt text. Even the Discourse AI feature is called “Caption with AI.” This point is made in a discussion of the manual “captioning” (alt text) method.
But https://talk.commonmark.org/ is currently bannered with “Please note the CommonMark spec is currently frozen with respect to features” and the image spec doesn’t appear to address the use of captions.
next
Would it be so bad to diverge from CommonMark in this case and implement something in Discourse to support the common <figcaption> tag for images?
I’m not an expert on accessibility, but I don’t understand this feature request. What is the difference, effectively, between alt and figcaption and why are you advocating that we diverge from CommonMark? What am I missing?
When I upload a photo, say of my cat, it is given a caption which is associated with the photo. I can then edit the caption to share context.
Alt text is available to sighted readers – but it requires mouse actions that I don’t typically take when scrolling through topics. Without an “alt” icon present, I’d not even thought to mouse over images to check for the presence of alt text. This actually makes some sense, as alt text isn’t meant to impart additional information, and should be superfluous to sighted users…
I’m not an accesibility expert either, but I see these features serving quite different purposes for both sighted and sight-impaired users.
alt text:
encouraged to provide a detailed description of the image for sight-impaired users, as an equivalent to the visuals
hidden by default from sighted users – because they can see the image
(presumably handled by default by screen readers and other accessibility tools)
figcaption:
can provide a title, aside, quote, or other context clue to all users – not neccesarily a full description of what the image depicts
is displayed in the flow of the document/post for all users, sighted or otherwise
requires no action to view, aside from normal browsing & scrolling
Essentially, alt text replaces the image – tells you exactly what it is. A figcaption can tell you why the author put it there.
Alt text for your image is accurate: “A gray tabby cat is sitting on a wooden railing outdoors, looking alert and curious with a green, leafy background.” (Accessibility folks might suggest even more detail and less subjectivity: “A gray tabby cat sits primly on a wooden bench outdoors, filling the frame and looking at something off-camera. The sunlit, leafy background is blurred while the cat is in the shade with its face in sharp focus.”)
A figcaption, though, might read “Cat with alt text example” – or “Ravenpaw is unconcerned with your pedantry.”
I can’t speak to broader implications of diverging from CommonMark – I just thought that if Commonmark has no plans to implement new features, divergence could be justified for something widely useful.