From e39f1e77ea97ed0cdee387dfd43c54b1ff75063a Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Mon, 2 Dec 2019 18:19:51 -0500 Subject: [PATCH] fix rich-text to unwrap lists with splitting, closes #3199 --- site/examples/rich-text.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/site/examples/rich-text.js b/site/examples/rich-text.js index 8d504a8c5..49b09865c 100644 --- a/site/examples/rich-text.js +++ b/site/examples/rich-text.js @@ -64,8 +64,16 @@ const withRichText = editor => { const { block: type } = command const isActive = isBlockActive(editor, type) const isListType = type === 'bulleted-list' || type === 'numbered-list' - Editor.unwrapNodes(editor, { match: { type: 'bulleted-list' } }) - Editor.unwrapNodes(editor, { match: { type: 'numbered-list' } }) + + Editor.unwrapNodes(editor, { + match: { type: 'bulleted-list' }, + split: true, + }) + + Editor.unwrapNodes(editor, { + match: { type: 'numbered-list' }, + split: true, + }) const newType = isActive ? 'paragraph' : isListType ? 'list-item' : type Editor.setNodes(editor, { type: newType })