feat(editor): 斜杠菜单新增「可运行代码块」条目
触发 openRunnableModal,配置后插入标准 CodeBlock(language 承载
'python runnable {...}' info string)。
This commit is contained in:
parent
5929ab68b4
commit
d6fc98d253
@ -107,6 +107,15 @@ export const SlashCommand = Extension.create<SlashCommandOptions>({
|
|||||||
editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
|
editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '可运行代码块',
|
||||||
|
description: '插入可被读者执行的代码块',
|
||||||
|
icon: '▶',
|
||||||
|
command: ({ editor, range }) => {
|
||||||
|
editor.chain().focus().deleteRange(range).run();
|
||||||
|
openRunnableModal(editor);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '分割线',
|
title: '分割线',
|
||||||
description: '插入水平分割线',
|
description: '插入水平分割线',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user