Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/block-library/src/heading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ export const settings = {

// In the list view, use the block's content as the label.
// If the content is empty, fall back to the default label.
if ( context === 'list-view' && ( customName || hasContent ) ) {
return customName || content;
if ( context === 'list-view' ) {
const listViewTitle =
customName || ( hasContent ? content : __( 'Heading' ) );
return sprintf(
/* translators: list view text. 1: heading level. 2: heading content. */
__( '%1$s: %2$s' ),
`H${ level }`,
listViewTitle
);
}

if ( context === 'accessibility' ) {
Expand Down