0

如果我选择一部分文本并尝试使其加下划线(使用 U 按钮),它可以工作并且 html 看起来像<u>...Text...</u>预期的那样。但是,当我在内容中使用这些 u-tag 初始化编辑器时,它们会被删除。

有谁知道解决方法?

4

1 回答 1

0

我发现 valid_elements 设置导致 tinymce 删除了 u-tags。在以前版本的 tinymce 中,这个设置从来没有遇到过这个问题,但这看起来更好并且有道理:我更新了设置并添加了

-u,

这解决了问题。这里是完整的 valid_elements 设置

 //The valid_elements option defines which elements will remain in the edited text when the editor saves.
valid_elements: "@[id|class|title|style]," +
"a[name|href|target|title]," +
"#p,-ol,-ul,-li,br,img[src],-sub,-sup,-b,-i,-u," +
"-span,hr", 
于 2011-06-09T08:50:26.417 回答