中编辑器粘贴选项不起作用

时间:2015-11-19 10:25:22

标签: javascript medium-editor

这是我的配置

new MediumEditor(".editor", {
    buttons: ['italic', 'bold', 'underline', 'anchor', 'unorderedlist', 'quote'],
    paste: {
        // This example includes the default options for paste, if nothing is passed this is what it used
        forcePlainText: false,
        cleanPastedHtml: true,
        cleanReplacements: [],
        cleanAttrs: ['id', 'style'],
        cleanTags: ['a', 'br']
    }
});

当我粘贴一些html文本时,我希望删除idstyle个attrs,以及abr标记。但那没有发生,请参阅plunker here

我做错了吗?

1 个答案:

答案 0 :(得分:1)

看起来这是你传入的选项名称:cleanPastedHtml vs cleanPastedHTML的驼峰套管之间的拼写错误。

如果您使用cleanPastedHTML,我相信这会解决您的问题。

相关问题