Skip to content

Commit e740fcf

Browse files
committed
Fix styled paragraph split
1 parent 3ceec4d commit e740fcf

File tree

1 file changed

+10
-1
lines changed
  • packages/block-library/src/paragraph

1 file changed

+10
-1
lines changed

packages/block-library/src/paragraph/edit.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,16 @@ class ParagraphBlock extends Component {
198198
content: nextContent,
199199
} );
200200
} }
201-
onSplit={ ( value ) => createBlock( name, { content: value } ) }
201+
onSplit={ ( value ) => {
202+
if ( ! value ) {
203+
return createBlock( name );
204+
}
205+
206+
return createBlock( name, {
207+
...attributes,
208+
content: value,
209+
} );
210+
} }
202211
onMerge={ mergeBlocks }
203212
onReplace={ this.onReplace }
204213
onRemove={ () => onReplace( [] ) }

0 commit comments

Comments
 (0)