diff --git a/tinymce-per-block/src/blocks/paragraph-block/index.js b/tinymce-per-block/src/blocks/paragraph-block/index.js index b8015d151a4391..9ad6796d1d3aa0 100644 --- a/tinymce-per-block/src/blocks/paragraph-block/index.js +++ b/tinymce-per-block/src/blocks/paragraph-block/index.js @@ -26,12 +26,14 @@ registerBlock( 'paragraph', { return { blockType: 'paragraph', align: rawBlock.attrs.align || 'no-align', - content: serialize( rawBlock.children ), + content: serialize( rawBlock.children[ 0 ].children ), }; }, serialize: ( block ) => { - const children = parse( block.content ); - const rawHtml = serialize( children ); + let children = parse( block.content ); + // Should probably be handled in the form + children = children.length === 1 && children[ 0 ].name === 'p' ? children[ 0 ].children : children; + const rawHtml = `
${ serialize( children ) }
`; return { type: 'WP_Block', @@ -40,7 +42,7 @@ registerBlock( 'paragraph', { startText: '', endText: '', rawContent: '' + rawHtml + '', - children + children: parse( rawHtml ) }; } } );