1

これは私の設定です

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テキストを貼り付けると、タグとタグだけでなく、属性も削除されることが期待idされます。しかし、それは起こっていません。ここでプランカーを参照してくださいstyleabr

私は何か間違ったことをしていますか?

4

1 に答える 1

2

これは、渡したオプション名をキャメルケースで囲んだcleanPastedHtmlvsのタイプミスだったようですcleanPastedHTML

代わりに使用cleanPastedHTMLすると、これで問題が解決すると思います。

于 2016-01-05T22:09:19.987 に答える