WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: How to dynamically fix thousands of images missing alt attributes using regular expression find and replace

for

From: Jonathan Avila
Date: Jun 14, 2019 2:11PM


Jared, can you explain what your thought is why images within a link should never have alt=""? Do you mean if the link has no other accessible name that would make sense but if the link had another accessible name that provided the purpose then the alt would be overwritten and so alt="" would be appropriate.

Jon

Sent from my iPhone

> On Jun 14, 2019, at 3:00 PM, Jared Smith < <EMAIL REMOVED> > wrote:
>
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
>> From what I recall though, the original person was asking how to update the alts for thousands of spacer images that are not informative, and it is impossible to do this manually one by one.
>
> This makes more sense. This could be useful for fixing these. The
> concern is that if a web sites has thousands of spacer images without
> an alt attribute, they almost certainly have loads of images that
> should have alt text defined. These would get caught up in the mix and
> be given alt="".
>
> One relatively simple improvement I would recommend is to detect if
> the image is inside a link. Such images should never have alt="", so
> it would be best to omit these.
>
> Thanks,
>
> Jared
> > > >