feat(editor): 斜杠菜单新增「可运行代码块」条目

触发 openRunnableModal,配置后插入标准 CodeBlock(language 承载
'python runnable {...}' info string)。
This commit is contained in:
xfy 2026-07-06 14:02:12 +08:00
parent 5929ab68b4
commit d6fc98d253

View File

@ -107,6 +107,15 @@ export const SlashCommand = Extension.create<SlashCommandOptions>({
editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
},
},
{
title: '可运行代码块',
description: '插入可被读者执行的代码块',
icon: '▶',
command: ({ editor, range }) => {
editor.chain().focus().deleteRange(range).run();
openRunnableModal(editor);
},
},
{
title: '分割线',
description: '插入水平分割线',