【发布时间】:2015-08-24 05:50:25
【问题描述】:
如何删除特定 CK 编辑器实例的样式。 我的页面中有两个 CKEditor。一种用于摘要,一种用于内容丰富。
总结一下,我不能允许复制粘贴样式,因为这会弄乱我们的设计。
我试过这个解决方案:
CKEDITOR.config.forcePasteAsPlainText = true;
CKEDITOR.replace( id, {
// Define the toolbar groups as it is a more accessible solution.
toolbarGroups: [
{"name":"basicstyles","groups":["basicstyles"]},
{"name":"links","groups":["links"]}
],
// Remove the redundant buttons from toolbar groups defined above.
removeButtons: 'Strike,Subscript,Superscript,Anchor,Styles,Specialchar'
} );
这会删除样式,但也会从内容中删除。
所以我的问题是如何在粘贴摘要时删除样式,以及在粘贴内容时如何保留样式。
【问题讨论】:
标签: javascript css ckeditor