File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/block-components/image Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ const Image = memo( props => {
269269 onError = { ( ) => setHasImageError ( true ) }
270270 className = { imageClasses }
271271 src = { src || undefined }
272- alt = { striptags ( props . alt || undefined ) }
272+ alt = { striptags ( props . alt || '' ) }
273273 title = { striptags ( props . title || undefined ) }
274274 width = { props . width || undefined }
275275 height = { props . height || undefined }
@@ -438,10 +438,10 @@ const ImageContent = props => {
438438 : undefined
439439
440440 const propsToPass = { }
441- const alt = striptags ( props . alt || undefined )
442- if ( alt ) {
443- propsToPass . alt = alt
444- }
441+
442+ // Allow explicit empty string for accessibility
443+ propsToPass . alt = striptags ( props . alt || '' )
444+
445445 const title = striptags ( props . title || undefined )
446446 if ( title ) {
447447 propsToPass . title = title
You can’t perform that action at this time.
0 commit comments