#microformats 2023-10-17
2023-10-17 UTC
gRegor joined the channel
# angelo MDN says `alt=""` "indicates that this image is *not* a key part of the content" and https://github.com/microformats/microformats2-parsing/issues/2#issuecomment-372150186 adopted the importance of that explicit behavior
# Loqi [preview] [kartikprabhu] Absence of `[alt]` is different from `[alt=""]` https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Omitting%20this%20attribute (fragmentioned URL)
So I suggest the following modification to @gRegorLove 's suggestion
- else if `img.u-...
[tw2113] joined the channel
gRegor joined the channel
# gRegor I know HTML validators have reported lack of alt attribute as an error for a while (some exceptions in https://html.spec.whatwg.org/multipage/images.html#guidance-for-conformance-checkers). That MDN page has been updated to not refer to omitting it since that github discussion
# The_Decryptor A purely decorative image should be marked up with https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/presentation_role just using an empty alt attribute is a mistake on the authors behalf
sebbu2, [jamietanna], [jeremycherfas], [benatwork], jeremycherfas and [KevinMarks] joined the channel
[campegg] joined the channel
# angelo in the same section linked by gRegor https://html.spec.whatwg.org/multipage/images.html#guidance-for-markup-generators it says "implementers should either set the alt attribute to the empty string, under the assumption that the image is a purely decorative image that doesn't add any information but is still specific to the surrounding content, or omit the alt attribute altogether, under the
# [schmarty] are we talking about something like this? https://www.w3.org/WAI/tutorials/images/decorative/#example-3-image-with-adjacent-text-alternative
# [tantek] best I could find on short notice is https://www.w3.org/WAI/WCAG21/Techniques/html/H37.html which seems incomplete
gRegor joined the channel
btrem and gRegorLove_ joined the channel
# btrem The MDN page does not agree with the HTML 5 spec re: image alt attribute. The MDN page https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#Omitting%20this%20attribute says "The alt attribute holds a text description of the image...."
# btrem The HTML spec https://html.spec.whatwg.org/multipage/images.html#alt says, "the value must be an appropriate replacement for the image."
# btrem Those are different. In fact, various HTML specs over the years have explicitly said that the alt text is *not* to provide a description.
# btrem And there are several examples where the advice is to include an empty alt attribute.
# btrem Here's an explicit proscription from the WHATWG spec: "It is important to realize that the alternative text is a replacement for the image, not a description of the image." So I think the MDN page is simply wrong, and I might just file an issue to have it changed.
# btrem Finally, as pertains to mf, I almost always use alt="" for images on my site because there is no useful alt text to replace the image. Usually because what might be good alt text is already on the page in prose. But I do use u-featured for a featured image.
[catgirlinspace] joined the channel