Alt text and media types for preformatted text

Philip Linde linde.philip at gmail.com
Mon Mar 1 09:54:33 GMT 2021
On 2/28/21, Caolan McMahon <caolan at caolan.uk> wrote:
> Ideally, the two would be separate. Most suggestions I've seen so far were
> to follow the opening ``` of a preformatted block with a mix of this data.
> However, there is also the option of adding data after the closing ```
> marker, keeping the two separate.
>
> My suggestion would be to place type information after the opening ```, and
> alt-text after the closing ```, for the following reasons:

Existing documents that use alt text as per the current spec will be
broken. Existing clients which MUST ignore any text following the
terminating ``` won't be able to access the alt text on new documents
following this suggestion. Seems like we'd be getting the worst of
both worlds.

> 1. Even for accessibility, I suspect knowing the content type is more
> practically useful to the client in the majority of existing cases. Most
> ASCII art is purely decoration, and knowing the content type is text/x-ascii
> (or similar) upfront is important so the screen reader can simply skip it.

How is the type more useful for accessibility than a general
description of its content? Would knowing in an art gallery whether
you're standing in front of an oil painting or an aquarelle be more
useful than knowing what the painting depicts? Need help browsing a
photo album? I'll help! I'll just read "photo, photo, photo, photo,
photo..." to you until you've had enough.

I also object to the idea that the purely decorational should simply
be skipped over. If it's not there for a reason, the author should be
the one skipping over it. Presumably it *is* there for some
informational purpose in which case there's no reason that the
information it communicates should be available to some users but not
others when alt text can be used to describe it to people who can't
see it directly.

> 2. Knowing the content type upfront would allow clients to present streaming
> data correctly using appropriate colours and escape codes for code
> highlighting, for example.

A solution to a problem of its own making.

--
Philip


Archive home | About this archive