如何禁用 Jodit 编辑器的列表类型?

问题描述 投票:0回答:3

我想将 Jodit 依赖项更新到最新版本,但我想禁用有序列表和无序列表的不同列表样式类型。 有什么办法可以实现这个目标吗?

在我当前使用的旧版本中,我可以简单地选择有序列表或无序列表。

在最新版本中有不同的样式,但我只想要

<ul></ul>
<ol></ol>
而不给用户选择选项值,例如“下阿尔法”或“下希腊语”

javascript wysiwyg jodit
3个回答
1
投票

我通过覆盖

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


0
投票

您可以使用 Jodit Playground 禁用插件。有序列表和无序列表属于同一组,可以通过这种方式禁用:

var editor = new Jodit("#editor", {
  "disablePlugins": "ordered-list"
});

之前:

之后:


0
投票

我通过将

undefined
传递到列表中成功实现了这一点。通过反复试验找到了它。

{
  controls: {
    ul: {
      list: undefined
    },
    ol: {
      list: undefined
    },
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.