File tree 1 file changed +4
-2
lines changed
packages/gatsby-source-wordpress/src/steps/source-nodes/create-nodes
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -670,7 +670,8 @@ export const replaceNodeHtmlImages = async ({
670
670
) {
671
671
gatsbyImageHydrationData = {
672
672
image : imageResize ,
673
- alt : cheerioImg ?. attribs ?. alt ,
673
+ // Wordpress tells users to leave "alt" empty if image is decorative. But it returns undefined, not ``
674
+ alt : cheerioImg ?. attribs ?. alt ?? `` ,
674
675
className : `${
675
676
cheerioImg ?. attribs ?. class || ``
676
677
} inline-gatsby-image-wrapper`,
@@ -686,7 +687,8 @@ export const replaceNodeHtmlImages = async ({
686
687
`img` ,
687
688
{
688
689
src : publicUrl ,
689
- alt : cheerioImg ?. attribs ?. alt ,
690
+ // Wordpress tells users to leave "alt" empty if image is decorative. But it returns undefined, not ``
691
+ alt : cheerioImg ?. attribs ?. alt ?? `` ,
690
692
className : `${
691
693
cheerioImg ?. attribs ?. class || ``
692
694
} inline-gatsby-image-wrapper`,
You can’t perform that action at this time.
0 commit comments