我想将 Jodit 依赖项更新到最新版本,但我想禁用有序列表和无序列表的不同列表样式类型。 有什么办法可以实现这个目标吗?
在我当前使用的旧版本中,我可以简单地选择有序列表或无序列表。
在最新版本中有不同的样式,但我只想要
<ul></ul>
或 <ol></ol>
而不给用户选择选项值,例如“下阿尔法”或“下希腊语”
我通过覆盖
ul
ol
控件的配置部分解决了这个问题。
__Editor = new Jodit('#editor', {
controls: {
ul: {
list: Jodit.atom({
default: 'Default'
})
},
ol: {
list: Jodit.atom({
default: 'Default'
})
}
}
});
Jodit.atom
导致替换默认值。
https://xdsoft.net/jodit/pro/docs/how-to/add-custom-font-family.md
您可以在插件定义文件中找到默认值: https://xdsoft.net/jodit/pro/docs/how-to/add-custom-font-family.md
您可以使用 Jodit Playground 禁用插件。有序列表和无序列表属于同一组,可以通过这种方式禁用:
var editor = new Jodit("#editor", {
"disablePlugins": "ordered-list"
});
我通过将
undefined
传递到列表中成功实现了这一点。通过反复试验找到了它。
{
controls: {
ul: {
list: undefined
},
ol: {
list: undefined
},
}
}