配置TinyMCE以在Composite C1中使用Font Awesome图标 [英] Configure TinyMCE for use of Font Awesome icons in Composite C1

查看:190
本文介绍了配置TinyMCE以在Composite C1中使用Font Awesome图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Composite C1 CMS,但是其中的自定义TinyMCE太疯狂了。简单的问题:我们想使用真棒字体图标。源代码编辑是可以的。
如果我们添加以下内容:

I use Composite C1 CMS, but the custom TinyMCE in it is so crazy. Simple issue: we'd like to use Font Awesome icons. Source code editing is OK. If we add the following:

<i class="fa fa-bus"></i>

已删除。好的,然后添加一个空格:

This is removed. OK then, add a space:

<i class="fa fa-bus">&#160;</i>

i 转换为 em

如果我在visualeditor.js文件的配置中更改了 valid_elements ,则什么也没有发生,仍然是同样的问题。

If I change valid_elements in config in the file visualeditor.js, nothing happens, still the same problem.

这个问题有解决方案吗?无论如何,向工具栏 添加图标中添加按钮会很好。

Are there any solution for this issue? Anyway it would be nice to add a button to the toolbar 'add icon'.

推荐答案

TinyMCE会默认删除空元素,因此您在标签之间添加& nbsp; 来告诉TinyMCE它不为空。同样,< i> 在旧版HTML中曾经是斜体,因此它试图将旧的斜体标签转换为首选的< em> 强调标签。确实,您可以将任何标签与Font Awesome一起使用,以便解决此问题,只需将您的< i> 更改为< span>

TinyMCE will remove empty elements by default, so you add a &nbsp; between your tags to tell the TinyMCE it's not empty. Also <i> used to be Italic in older versions of HTML so it's trying to convert an old italic tag into a preferred <em> Emphasis tag. Really though, you can use any tag with Font Awesome so to fix this issue, just change your <i> to a <span>:

< span class = fa fa-bus& nbsp;< / span>

这篇关于配置TinyMCE以在Composite C1中使用Font Awesome图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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