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
−0

Mention decorative images in the reminder

Problem with a custom approach

I'm wary of adding something to Markdown that will be specific to Codidact (or even QPixel). Is there a way of doing this that would leave the Markdown still compatible with export to places that do not have that modification? I wouldn't want improved accessibility for Codidact to come at the cost of worsened accessibility in content exported by a well-meaning person.

Blank alt text is supported but not advertised

An author needs to be able to include an alt attribute, but have its value set to an empty string (""). Uploading an image gives Markdown with default text. If the author deletes this default text, the Markdown will go from being

![Image_alt_text](image_url)

which is converted to HTML as

<img alt="Image_alt_text" src="image_url">

to being

![](image_url)

which is converted to HTML as

<img alt="" src="image_url">

so the alt attribute is created even when blank, as required.

The reminder about alt text is shown when the author tries to save the post, but pressing save a second time accepts the empty alt text. So there is already a way to leave alt text empty, it just isn't advertised to the post author.

Problem with only reminding for the default text

I like the reminder being there when the alt text is left as the default, but if the author has actively deleted the alt text it's tempting to treat this as sufficient indication of a conscious decision that the reminder can be omitted. That is, we could only show the reminder for the default alt text, and not for empty alt text.

However, it is possible to write image Markdown directly, without using the upload tool, for example to include an image that is already at a URL rather than needing to be uploaded. Blank alt text here is not strong evidence of a conscious decision.

Explicit mention in the reminder

I propose that the reminder wording be amended to include mention of decorative images, so that the deletion of the default alt text is shown to be a valid approach for purely decorative images, but authors who manually write image Markdown still have a reminder to add alt text in all other cases.

Changes to other standards

This still leaves the raw Markdown not explicitly communicating to future readers that this decision is intentional. Other than HTML comments, I don't see a way of communicating this that would not also make the Markdown non-standard and therefore tied to Codidact.

Changes could be proposed to the HTML standard, or to CommonMark (the Markdown standard Codidact uses). Unless/until such changes are made, mentioning decorative images in the reminder is my preferred approach.

History

1 comment thread

Affirmation (1 comment)
Affirmation
Mr. Beedell, Roke Julian Lockhart (RJLB)‭ wrote 9 months ago · edited 9 months ago

However, it is possible to write image Markdown directly, without using the upload tool, for example to include an image that is already at a URL rather than needing to be uploaded. Blank alt text here is not strong evidence of a conscious decision.

I usually author CommonMark as /plain, so I agree; I wouldn't want it to be an indicator of intentionality.