Skip to content

Commit

Permalink
Revise paragraph logic to use pattern override content
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiomorales committed Sep 13, 2024
1 parent 3f941e5 commit b0c7892
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/block-library/src/paragraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@ export const settings = {
__experimentalLabel( attributes, { context } ) {
const customName = attributes?.metadata?.name;

if ( context === 'list-view' && customName ) {
return customName;
}

if ( context === 'accessibility' ) {
if ( customName ) {
if (
customName &&
! attributes?.metadata?.bindings?.source === 'pattern/overrides'
) {
return customName;
}

const { content } = attributes;
return ! content || content.length === 0 ? __( 'Empty' ) : content;
}

if ( context === 'list-view' && customName ) {
return customName;
}
},
transforms,
deprecated,
Expand Down

0 comments on commit b0c7892

Please sign in to comment.