0
我想刪除用戶粘貼到ckeditor時的內容格式。我試過這段代碼,但它不起作用。請幫我刪除粘貼事件中的內容
CKEDITOR.on('instanceReady', function (e) {
editor = e.editor;
editor.on('paste', function (e) {
editor.focus();
editor.document.$.execCommand('SelectAll', false, null);
editor.execCommand('RemoveFormat', editor.getSelection().getNative());
editor.insertHtml('additional content');
});
});
forcePasteAsPlainText剝離a,ul,ol,li ...(僅舉幾個例子),而RemoveFormatting函數則沒有。 – whitehat101