CKEditor和转义元素 [英] CKEditor and escaping elements

查看:409
本文介绍了CKEditor和转义元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 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 &nbsp; or zero-width space &#8203; within it to preserve your tag.

您也可以从 CKEDITOR.dtd中删除 i $ removeEmpty object。但是,这可能会破坏其他空的< 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆