CkEditor - setting allowedContent to true doesnt disable ACF

777 Views Asked by At

I want to disable ACF on ckeditor, and as many post and documentation suggest, i am setting allowedcontent to true by below ways, still its filtering out my html.

CKEDITOR.config.allowedContent = true;

CKEDITOR.editorConfig = function( config ) {

config.allowedContent = true;

// also tried CKEDITOR.allowedContent = true; and CKEDITOR.config.allowedContent = true;

 };

I trying to insert my custom tag as below, in my plugin code.

CKEDITOR.plugins.add('MakeCPBold', {
 init: function (editor) {
     editor.addCommand('MakeCPBoldCommand', {           
         exec: function (editor) {              
             editor.insertHtml('<CP:CP_B>Sample Content</CP:CP_B>');                               
         }
     });         
     editor.ui.addButton('MakeCPBold', {
         label: 'Make CP Bold',
         command: 'MakeCPBoldCommand',
         icon: this.path + 'images/makeabbr.gif',
         toolbar: 'Basic'

    });
 }

});

insertHtml just inserts the "Sample Content" and filters custom tag CP:CP_B. Replacing tag CP:CP_B with any known tag(like strong) works fine.

Am I configuring it correctly?

I am using latest version of ckeditor 4.4.1. Also tried version 4.4.0 and 4.2

Thanks

1

There are 1 best solutions below

1
On

CKEditor is HTML text editor, not XML editor. Don't expect it to support all XML features like namespaces. Use data-foo attributes to distinguish custom stuff from standard data.