diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index 5d38f4d9131bf9..6974f045102c65 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -1734,7 +1734,20 @@ const canInsertBlockTypeUnmemoized = ( rootClientId ) ) { - return false; + // Allow inserting a Paragraph block anywhere that another Paragraph block already exists + // when in contentOnly mode. + if ( blockName === 'core/paragraph' ) { + const existingBlocks = getBlockOrder( state, rootClientId ); + const hasParagraphBlock = existingBlocks.some( + ( clientId ) => + getBlockName( state, clientId ) === 'core/paragraph' + ); + if ( ! hasParagraphBlock ) { + return false; + } + } else { + return false; + } } const parentName = getBlockName( state, rootClientId ); @@ -1901,7 +1914,24 @@ export function canRemoveBlock( state, clientId ) { rootClientId ) ) { - return false; + // Allow removing a Paragraph block when other Paragraph blocks exist + // in contentOnly mode. + const blockName = getBlockName( state, clientId ); + if ( + rootBlockEditingMode === 'contentOnly' && + blockName === 'core/paragraph' + ) { + const existingBlocks = getBlockOrder( state, rootClientId ); + const paragraphBlocks = existingBlocks.filter( + ( id ) => getBlockName( state, id ) === 'core/paragraph' + ); + // Allow removal if there are other paragraph blocks besides this one + if ( ! ( paragraphBlocks.length > 0 ) ) { + return false; + } + } else { + return false; + } } return rootBlockEditingMode !== 'disabled';