Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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

+4
−3

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 ![!decorative](image URL) - 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?

History

2 comment threads

Where do you expect decorative images to be used here? (1 comment)
What's a "decorative" image? (3 comments)
Post
+1
−1

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:

Image upload dialog box with a checkbox for purely decorative images and a file input box

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 -->
![](image_url)

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.

History

1 comment thread

I feel this approach is a bit too low friction (3 comments)
I feel this approach is a bit too low friction
Derek Elkins‭ wrote 9 months ago

I like the HTML comment idea as a way to indicate a decorative image in Markdown without modifying the Markdown syntax, but I'm much less keen on a simple checkbox as the way to indicate it. I feel like people who are annoyed about the alt-text pop-ups will quickly learn to check that box to avoid them. An approach with a bit more friction for this atypical use-case is what I'd want. I don't have a good idea of what that is. As an idea, maybe typing "!decorative" as the alt-text (and this being documented in the pop-up) would trigger this.

Admittedly, I'm not really sure what the use-cases of decorative images are here.

trichoplax‭ wrote 9 months ago

This answer is my secondary recommendation, with my other answer being my preference. However, if this is implemented, I wouldn't want there to be friction.

I explain in my answer to Remove the timer before saving a post when an image has no alt text why I see friction (even with good intention) as a bad thing.

trichoplax‭ wrote 9 months ago

As for use cases, I also imagine there being very few, so this seems low priority whatever approach is (or isn't) settled on.