TinyMCE正在删除< style>标签 [英] TinyMCE is removing <style> tags

查看:258
本文介绍了TinyMCE正在删除< style>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了TinyMCE的问题。当我在TinyMCE的HTML编辑器中输入样式标签时,它会在我单击更新时删除标签。

 < style type =text / css> 
.newclasss {color:#c9c9c9; }
< / style>

我的有效元素如下:

 < script type =text / javascript> 

var valid_elms =hr [class | width | size | noshade];
valid_elms + =span [class | align | style],;
valid_elms + =font [face | size | color | style],;
valid_elms + =img [href | src | name | title | onclick | align | alt | title |;
valid_elms + =width | height | vspace | hspace],;
valid_elms + =iframe [id | class | width | size | noshade | src | height |;
valid_elms + =frameborder | border | marginwidth | marginheight |;
valid_elms + =target | scrolling | allowtransparency],style;

extended_valid_elements:valid_elms
< / script>

任何人都可以帮助。

解决方案

由于样式标签不是有效的XHTML,TinyMCE禁用在标签之外添加它们的能力。



您必须在有效的儿童设定中新增样式标记

  valid_children:+ body [style]
pre>

编辑:此解决方案适用于版本3.4.2



来源


I'm facing a problem with TinyMCE. When I enter a style tag in the HTML editor of TinyMCE, it removes the tags when I click update.

<style type="text/css"> 
     .newclasss { color:#c9c9c9; } 
</style>

My valid elements are follows:

<script type="text/javascript">

var valid_elms = "hr[class|width|size|noshade]";
valid_elms    += "span[class|align|style],";
valid_elms    += "font[face|size|color|style],";
valid_elms    += "img[href|src|name|title|onclick|align|alt|title|";
valid_elms    += "width|height|vspace|hspace],";
valid_elms    += "iframe[id|class|width|size|noshade|src|height|";
valid_elms    += "frameborder|border|marginwidth|marginheight|";
valid_elms    += "target|scrolling|allowtransparency],style";

extended_valid_elements: valid_elms
</script>

Can anyone help please??

解决方案

Since style tags are not valid XHTML, TinyMCE disabled the ability to add them outside of the tags.

You have to add style tags to the valid children configuration

valid_children : "+body[style]"

Edit: This solution applies to version 3.4.2

Source

这篇关于TinyMCE正在删除&lt; style&gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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