【发布时间】:2016-12-14 18:59:47
【问题描述】:
在 TinyMCE 的代码(源代码)编辑器中,当我想添加一些带有类的 span 或 i 元素时(例如,当我想添加 Font Awesome 图标时) - TinyMCE 删除类。例如,如果我想添加:
<span class="fa fa-university"></span>
最后我会:
<span></span>
另外,在源代码编辑器中,我尝试添加 <i class="fa fa-university"></i>,但问题是一样的 - TinyMCE (<i></i>) 删除了类。
我使用的是 TinyMCE v4.4.1,这些是我的设置:
tinymce.init({
selector: '#body',
height: 500,
theme: 'modern',
plugins: [
'advlist autolink lists link image charmap preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern codesample fontawesome noneditable'
],
toolbar1: 'insertfile undo redo | formatselect fontselect fontsizeselect fontawesome',
toolbar2: 'bold italic underline strikethrough forecolor backcolor removeformat superscript subscript | alignleft aligncenter alignright alignjustify | outdent indent',
toolbar3: 'code preview | link unlink anchor image media | codesample | bullist numlist table blockquote hr nonbreaking | charmap emoticons | visualchars visualblocks',
image_advtab: true,
relative_urls: false,
extended_valid_elements: 'span',
content_css: '/css/all.css' // this includes fontwawesome...
});
【问题讨论】:
标签: tinymce font-awesome wysiwyg tinymce-4 glyphicons