From 1022682d82d7d05d26ff9552693951196a54da8b Mon Sep 17 00:00:00 2001 From: jerry-lllman <45385120+jerry-lllman@users.noreply.github.com> Date: Tue, 11 Mar 2025 00:21:29 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=88docs=EF=BC=89:=20correct=20block=20?= =?UTF-8?q?matching=20condition=20in=20`Executing=20Commands`=20example=20?= =?UTF-8?q?(#5808)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/walkthroughs/05-executing-commands.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/walkthroughs/05-executing-commands.md b/docs/walkthroughs/05-executing-commands.md index 478e592f8..de09d1ace 100644 --- a/docs/walkthroughs/05-executing-commands.md +++ b/docs/walkthroughs/05-executing-commands.md @@ -53,7 +53,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 } @@ -105,7 +105,7 @@ const CustomEditor = { Transforms.setNodes( editor, { type: isActive ? null : 'code' }, - { match: n => Editor.isBlock(editor, n) } + { match: n => Element.isElement(n) && Editor.isBlock(editor, n) } ) }, }