W3C - make image twig output empty ALT attribute when no ALT text is provided

Created on 19 January 2021, almost 4 years ago
Updated 30 October 2023, about 1 year ago

Problem/Motivation

Images without an ALT attribute will fail basic W3C HTML validation.

Steps to reproduce

  1. Add an image to a content page or slideshow ... and neglect to provide any ALT text.
  2. Validate the HTML using W3C validator to see the error message about < img > must always have alt="" at the very least.

Proposed resolution

Modify the image twig to at least output an empty ALT attribute when no ALT text attribute is provided, and of course also output the ALT text when that is available.

Remaining tasks

None

🐛 Bug report
Status

Closed: won't fix

Version

4.0

Component

Templates

Created by

🇨🇦Canada gdaw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024