unsetMark 命令
unsetMark 将从当前选择中删除标记。也可以删除当前选择中的所有标记。
参数
typeOrName: string | MarkType
应该被删除的标记类型。
options?: Record<string, any>
extendEmptyMarkRange?: boolean- 即使在当前选择中也删除标记。默认值为false
使用 unsetMark 命令
// 移除粗体标记
editor.commands.unsetMark('bold')
// 在当前选择中移除粗体标记
editor.commands.unsetMark('bold', { extendEmptyMarkRange: true })