CKEditor和转义元素 [英] CKEditor and escaping elements
问题描述
我使用 CKEditor 更新 CMS 内容。我也使用FontAwesome,其中包括一组花哨的图标,可以像这样显示
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
<i class="icon-envelope"></i>
$ b <标签,我在源模式下看不到它。
The problem is that CKEditor escapes this i
tag on client side, and I can't see it in source mode.
如何允许此标记?我尝试了 CONFIG.removeFormatTags =''
,但它没有帮助。
How I can allow this tag? I have tried CONFIG.removeFormatTags = ''
, but it dies not help.
推荐答案
它被删除,因为它是空的。在其中保留一些不间断的空格& nbsp;
或零宽度空格&#8203;
It is removed because it is empty. Put some non-breaking space
or zero-width space ​
within it to preserve your tag.
您也可以从 CKEDITOR.dtd中删除
object。但是,这可能会破坏其他空的 i
$ removeEmpty < i>
标签,而不包含 class =icon-envelope
。要解决此问题,您需要使用数据处理器来过滤空的< ;没有
很容易我猜。 class =icon-envelope
的i>
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.
这篇关于CKEditor和转义元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!