diff --git a/docs/walkthroughs/04-applying-custom-formatting.md b/docs/walkthroughs/04-applying-custom-formatting.md index 5213891fe0..5fea3c7c2e 100644 --- a/docs/walkthroughs/04-applying-custom-formatting.md +++ b/docs/walkthroughs/04-applying-custom-formatting.md @@ -39,7 +39,7 @@ const App = () => { Transforms.setNodes( editor, { type: match ? 'paragraph' : 'code' }, - { match: n => Editor.isBlock(editor, n) } + { match: n => Element.isElement(n) && Editor.isBlock(editor, n) } ) } }} @@ -90,7 +90,7 @@ const App = () => { Transforms.setNodes( editor, { type: match ? 'paragraph' : 'code' }, - { match: n => Editor.isBlock(editor, n) } + { match: n => Element.isElement(n) && Editor.isBlock(editor, n) } ) break } @@ -178,7 +178,7 @@ const App = () => { Transforms.setNodes( editor, { type: match ? null : 'code' }, - { match: n => Editor.isBlock(editor, n) } + { match: n => Element.isElement(n) && Editor.isBlock(editor, n) } ) break }