Welcome to Codidact Meta!
Codidact Meta is the "town hall" (meta-discussion site) for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
Comments on Add an explicit Markdown syntax for decorative images
Parent
Add an explicit Markdown syntax for decorative images
When uploading an image on a Codidact community, users are prompted to add alt text - a text alternative to an image - for that image. If they go to submit a post without doing so, or when submitting a post with blank alt text, they are reminded with a link to the help center page on alt text.
However, in certain cases, particularly for decorative images, blank alt text is the correct approach. The problem is that whether or not it's appropriate in a particular case is not something that can be detected programmatically, and so users who are correctly setting a decorative image to have blank alt text will still be prompted to set alt text for the image (although it will not prevent the post from being submitted with the default or blank alt text).
To make it clearer to the system and to any potential editors, though, I'd like to propose an explicit Markdown syntax for decorative images, which can then be served with blank alt text by the system.
This should be something like  - something unlikely to be used unintentionally and that makes it clear to both the system and human editors that this is an intentional usage of this syntax. The system then knows to serve this image with the alt attribute set to alt="".
Is something along these lines possible to add to the Markdown handling for QPixel?
Mention decorative images in the reminder Problem with a custom approach I'm wary of adding something to Markdown that …
9mo ago
Insert an HTML comment for a decorative image A checkbox could be included in the Image Upload dialog box, allowing a u …
9mo ago
There is already too much nanny-ware in the world, Codidact shouldn't be adding to it. Whether an author includes alt …
9mo ago
Post
Insert an HTML comment for a decorative image
A checkbox could be included in the Image Upload dialog box, allowing a user to indicate that the image is purely decorative:
The Markdown that results from uploading an image could then have an HTML comment prepended to indicate to future editors that this image deliberately has no alt text for this reason:
<!-- This image has blank alt text because it is purely decorative -->

Note that the newline between the HTML comment and the image Markdown is required, otherwise the image Markdown is not registered as Markdown and remains raw text in the rendered post.
This approach is compatible with both CommonMark (the Markdown standard Codidact uses) and HTML standards, so the post will still display correctly (and accessibly) if exported to anywhere that supports these standards.

2 comment threads