diff --git a/packages/block-library/src/gallery/save.js b/packages/block-library/src/gallery/save.js index 7c0d27741bfcd6..11feb8412b2491 100644 --- a/packages/block-library/src/gallery/save.js +++ b/packages/block-library/src/gallery/save.js @@ -41,9 +41,9 @@ export default function save( { attributes } ) { break; } - let alt = image.alt || image.caption || ''; + let alt = image.alt || image.caption; - if ( alt !== __unstableStripHTML( alt ) ) { + if ( alt && alt !== __unstableStripHTML( alt ) ) { alt = __unstableStripHTML( alt ); }