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: '插入水平分割线',