Skip to content

Commit

Permalink
update onPaste
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae committed Jul 12, 2024
1 parent 9322fa7 commit 71fe17c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/block/icon-list-item/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ export const useOnPaste = ( clientId, parentClientId, attributes, setAttributes
mode: 'BLOCKS',
} )

const items = list[ 0 ].innerBlocks
// If list[0] has inner blocks, it has been converted to core/list block, else list has core/paragraph elements.
const items = list[ 0 ].innerBlocks.length ? list[ 0 ].innerBlocks : list

const content = items.map( item => item.attributes.content.toPlainText().replaceAll( '\n', '<br>' ) )

Expand Down

0 comments on commit 71fe17c

Please sign in to comment.