Skip to content

Commit

Permalink
Do not assign empty string to alt on save
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart authored and ockham committed Nov 2, 2020
1 parent 9da56ed commit 5359033
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/gallery/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit 5359033

Please sign in to comment.