Skip to content

Commit

Permalink
Fix block validation errors caused by amp-fit-text deprecation (#6872)
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Feb 3, 2022
1 parent 8d7f2eb commit df53963
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion assets/src/block-editor/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ export const removeAmpFitTextFromBlocks = ( settings, name ) => {
settings.deprecated = [];
}

settings.deprecated.unshift( {
// Prevent adding deprecation a second time.
for ( const deprecated of settings.deprecated ) {
if ( deprecated.attributes && deprecated.attributes.ampFitText ) {
return settings;
}
}

settings.deprecated.push( {
supports: settings.supports,
attributes: {
...( settings.attributes || {} ),
Expand Down

0 comments on commit df53963

Please sign in to comment.