CKEditor and shielding elements

I use CKEditor to update CMS content on my website. I also use FontAwesome, which includes a set of icons that can be displayed as follows

<i class="icon-envelope"></i>

The problem is that CKEditor hides this tag ion the client side, and I do not see it in native mode.

How can I enable this tag? I tried CONFIG.removeFormatTags = '', but he does not know how.

+5
source share
2 answers

It is deleted because it is empty. Place some non-breaking space &nbsp;or zero width space in &#8203;it to save the tag.

i CKEDITOR.dtd.$removeEmpty. , , <i> class="icon-envelope". , <i>'s class="icon-envelope". , .

+10

.. , config.fillEmptyBlocks

CKEDITOR.editorConfig = function( config ) {
       config.fillEmptyBlocks="&#8203;";  
}
CKEDITOR.dtd.$removeEmpty['span'] = false;
CKEDITOR.dtd.$removeEmpty['i'] = false;
0

All Articles