Skip to content

Commit 594b5b1

Browse files
committed
Add an inline comment
1 parent 3bfbacd commit 594b5b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/block-editor/src/components/writing-flow/use-clipboard-handler.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ export default function useClipboardHandler() {
215215
if ( canInsertBlockType( block.name, rootClientId ) ) {
216216
newBlocks.push( block );
217217
} else {
218+
// If a block cannot be inserted in a root block, try
219+
// converting it to that root block type and insert the
220+
// inner blocks.
221+
// Example: paragraphs cannot be inserted into a list,
222+
// so convert the paragraphs to a list for list items.
218223
const rootBlockName = getBlockName( rootClientId );
219224
const switchedBlocks =
220225
block.name !== rootBlockName

0 commit comments

Comments
 (0)