Hi,
I am trying to remove the image plugins using the following code:
CKEDITOR.on( 'instanceCreated', function( event ) { var editor = event.editor, element = editor.element; editor.on( 'configLoaded', function() { editor.config.removePlugins = 'base64Image,image,image2'; // Rearrange the layout of the toolbar. editor.config.toolbarGroups = [ { name: 'clipboard', groups: [ 'undo','clipboard' ] }, { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'align'] }, //{ name: 'links' }, { name: 'colors' }, ]; editor.config.removeButtons = 'Underline,Subscript,Superscript'; editor.config.extraPlugins = 'sharedspace'; editor.config.sharedSpaces = {top: 'toolbarTop'}; }); });
CKEditor seems to be removing the img tags from the DOM when removing the image plugins.
It does seems to be a problem with removing image2 plugin.
How do i prevent the removal of my img tags?
Thanks
Michael
This is not a bug, but
This is not a bug, but indented behaviour. Feature that drives this is called the Advanced Content Filter. It is configured by features enabled in CKEditor. When you remove image button from toolbar or remove entire plugin, then image is not being enabled any more and therefore it's filtered out.
The way how you could keep images depends on what do you want to achieve and why have you removed image plugins. One of the way may be extending Advanced Content Filter using the config.extraAllowedContent option. For example:
But you can add more attributes, classes or styles if you want. Read more about the Allowed Content Rules.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+