How can I remove the styling for a specific CK editor instance. I have two CKEditors in my page. One restricted for summary and one rich for content.
For the summary I can't allow the copy paste styling because that can mess our design.
I tried this solution:
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'
} );
This removes the styling but removes from the contents too.
So my question is how to remove the styling when I paste in the summary and how to keep the styling when I paste for the content.
In your code snippet I can see:
This isn't a correct way to set configuration options. This will change this setting for all existing editors. What you want to do is to move this setting to
CKEDITOR.replace()
:Read more in setting configuration.