我有一个tinyMCE组件。下划线是用微小的制成的。我想自动更改
<u>
中的所有 <span style="text-decoration: underline">
。
我知道您可以要求tiny使用“有效元素”自动更改其他标记中的一些标记。它适用于以下“storng”和“em”代码,但不适用于下划线:
valid_elements: "#p,strong,b,em,i,u,span[style=text-decoration: underline],span[style=text-decoration: underline]/u,strong/b,em/i"
还有其他方法可以做到这一点吗? ==> 当富文本有 <u>underlined text</u>
时,它会自动更改并另存为 <span style="text-decoration:underline">underlined text</span>
。谢谢您的解答!
您可以使用初始化部分中的样式格式更改它。类似于以下内容:
tinyMCE.init({
...
style_formats : [
// use the following for inline style - not exactly sure on the syntax for text decoration
{title : 'Underline', inline : 'span', styles : {textDecoration : 'underline'}},
// or use the following if you want to add a class
{title : 'Underline', inline : 'span', classes : 'underline'},
]
});