wrapInList 命令

wrapInList 将当前选择中的节点包裹在一个列表中。

参数

typeOrName: string | NodeType

要包装所选内容的列表节点的类型或名称。

attributes?: Record<string, any>

应该应用于列表的属性。这是可选的。

使用 wrapInList 命令

// wrap a paragraph in a bullet list
editor.commands.wrapInList('bulletList')