Adding an empty alt tag for uploaded image

Using Ghost 3.16.1

An accessibility review turned up some issues with missing alt tags on our images, but as these are ‘decorative’ they would require an empty alt tag (Decorative Images | Web Accessibility Initiative (WAI) | W3C)

Tried to do this in the editor, but if I set an alt tag as empty, the attribute is not added / rendered.

It seems the only way to do this is by uploading an image to a third-party and manually creating an HTML tag.

This would be a useful feature / addition to the wysiwyg editor, so any ideas?

Thanks

This is a very specific/niche usecase. Using an HTML card seems like the correct approach to me here - which is designed to give you full control of markup when you need it - exactly like for things like this.

You don’t need to upload the image to an external service, however, you can upload the image to ghost, copy its image location by previewing the post, then paste that into the HTML card.

1 Like

Bearing in mind the people doing this are content editors not dev’s, this seems like a hacky workaround that is hard to explain.

As Accessibility is a requirement for the web, the system should make this easy to achieve otherwise we just end up with another WordPress debacle.

Using decorative images in post content seems like the hacky workaround that is hard to explain tbh.

Accessibility is indeed important, that’s exactly why screen readers read out file names - which is not functionality that should be disabled except for in very specific circumstances where the image no semantic meaning.

If you’re making images part of your content with no semantic meaning, then you should probably consider using CSS, JavaScript, putting them in the layout, or really anything else that doesn’t spam post content with meaningless images.

A good system does not make it as easy as possible to mis-use accessibility features. That is not a feature of a good system at all.

If the image is a portrait of a person in the context of something about that person, then empty alt text is something recommended by the WAI: WebAIM: Alternative Text (Example 1 & 2), so I would suggest that this is not a hacky workaround.