-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gatsby-source-wordpress): Set empty default alt tag for inline images #38341
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Lennart! 🙌
Thank you for the fix!! To satisfy my own curiosity, how does |
@therealgilles I think This PR was addressing handling of images embeded in html content (for example in a post main content) to create responsive variants of it, so while both are dealing with images - those are 2 different/separate things. We do get content as html "snippet" and we parse that html to find images, so that's why we deal with actual html attributes ( |
@pieh Oh interesting! The warning seemed to occur from a Declaring the prop as mandatory is a bit of joke though, considering how HTML has been working for years, i.e. images still display without it. The official directive that it has to be there but can be empty is non-sensical in my book. I'm all for accessibility but it has to start with the tools. Anyway, thanks again for fixing this and for taking the time to explain. |
I don't know all the details on how things are connected here in this change as wordpress is not really my area in Gatsby context. I just tried doing few quick greps/code searches for |
@pieh I appreciate the honesty and it all sounds logical. I'll finish with it'd be helpful if Gatsby (really |
Description
WordPress seems to set
undefined
for the alt tag of an image if it's empty.gatsby-plugin-image
requires analt
tag so this PR uses nullish coalescing to set an empty string as a default.Tests
No tests added
Related Issues
Fixes #38259