From d6fc98d253d1ad6fd6f0193fd5cf90b6bd28784a Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 6 Jul 2026 14:02:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E6=96=9C=E6=9D=A0=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=96=B0=E5=A2=9E=E3=80=8C=E5=8F=AF=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9D=97=E3=80=8D=E6=9D=A1=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 触发 openRunnableModal,配置后插入标准 CodeBlock(language 承载 'python runnable {...}' info string)。 --- libs/tiptap-editor/src/slash-command.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/tiptap-editor/src/slash-command.ts b/libs/tiptap-editor/src/slash-command.ts index 5e6864d..28caee0 100644 --- a/libs/tiptap-editor/src/slash-command.ts +++ b/libs/tiptap-editor/src/slash-command.ts @@ -107,6 +107,15 @@ export const SlashCommand = Extension.create({ editor.chain().focus().deleteRange(range).toggleCodeBlock().run(); }, }, + { + title: '可运行代码块', + description: '插入可被读者执行的代码块', + icon: '▶', + command: ({ editor, range }) => { + editor.chain().focus().deleteRange(range).run(); + openRunnableModal(editor); + }, + }, { title: '分割线', description: '插入水平分割线',