💾 Archived View for rawtext.club › ~sloum › geminilist › 007124.gmi captured on 2023-11-14 at 08:50:09. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
Oliver Simmons oliversimmo at gmail.com
Wed Sep 15 16:21:08 BST 2021
- - - - - - - - - - - - - - - - - - -
On Mon, 13 Sept 2021 at 16:18, mntn <mntn at mntn.xyz> wrote:
I am confident that the best option is just to use the name of the language as the alt text. Alt text of "javascript" is fairly clear as to what follows in the preformatted text block--so it still works as alt text--and a syntax highlighter could use that hint for parsing the text and highlighting the code. A properly designed syntax highlighter will give up and fail quietly/safely if it can't parse the code for whatever reason, say if it's actually a poem titled "javascript" instead of code.
Personally I think using the MIME type would be most sensible, it'swhat's already done when a page is received, so it'd make developmenteasier for clients.(I'm including non-""official"" MIME types. The ""official"" coverageof source code files is a bit lacking)
Clients may want to ignore anything following a space or punctuation, so alt text could be even more descriptive, such as "javascript: excerpt from example.js" or "HTML example."
Big +1 to this :)
These two examples given here don't seem to be useful, if the clientis adding syntax highlighting then it can probably generate analt-text saying "HTML source code" by itself.Stating that it's an example or something is highly likely to be donein the normal text anyways.
However, I imagine making a screen-reader read code would be absolute hell!So it would be extremely useful for this to be a thing, so the codecan be roughly described in a screen-reader safe way.
-Oliver Simmons (GoodClover)