Let’s say I have images with alternate text that serves no purpose other than to add visuals to my website. Here’s an example:
<img src="..." alt="my first picture">
<img src="..." alt="my second picture">
I’ve been trying to remove whatever text that is in alternate text. This is the command that I need to execute that removes whatever alternate text that is considered decorative:
find modl/posts/ -name "*.html" -exec sed 's/alt="[^ \/]*\( .*\)">/alt="">/g' {} \;
With that in mind, I want it to be something like:
<img src="..." alt="">
<img src="..." alt="">
How would i accomplish this with one command without having to go through each HTML file to remove what is in alt=“” attribute?
PS: I ask that you please do not read outside the context of my post. The Web Content Accessibility Guidelines cover Success Criterion 1.1.1 and that standard covers different types of images. I need to remove alternate text inside quotes that should only serve the purpose (“why?”) and not tell what the content is about (“what?”).
Thank you.