CKEditor and escaping elements

前端 未结 3 906
一整个雨季
一整个雨季 2021-01-18 13:36

I\'ve using CKEditor for updating CMS content on my website. I also using FontAwesome, which includes set of fancy icons, that can be displayed like this

&l         


        
相关标签:
3条回答
  • 2021-01-18 13:49

    It is removed because it is empty. Put some non-breaking space   or zero-width space ​ within it to preserve your tag.

    You can also remove i from CKEDITOR.dtd.$removeEmpty object. This may, however, break other empty <i> tags without class="icon-envelope". To fix this you would need to play with a data processor to filter empty <i>'s without class="icon-envelope". Pretty easy I guess.

    0 讨论(0)
  • 2021-01-18 13:52

    You can use unicode of &zwnj; in situation of html code showing in CKEditor for making Zero-width non-joiner (mini-space) in languages like persian.

    می‌خواهم می‌توانم

    0 讨论(0)
  • 2021-01-18 13:54

    below worked for me.. thanks to Vince Kronlein pointing out config.fillEmptyBlocks

    CKEDITOR.editorConfig = function( config ) {
           config.fillEmptyBlocks="&#8203;";  
    }
    CKEDITOR.dtd.$removeEmpty['span'] = false;
    CKEDITOR.dtd.$removeEmpty['i'] = false;
    
    0 讨论(0)
提交回复
热议问题