我希望能够插入空的div和span元素,像[something]这样的文本,但是当我保存时,TinyMCE正在删除所有这些代码。
是否有配置选项告诉TinyMCE返回我输入的确切文本?
感谢。
答案 0 :(得分:0)
是的,您需要将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|onmouseover]," +
"a[name|href|target|title|alt]," +
"p,blockquote,-ol,-ul,-li,br,img[src|height|width],-sub,-sup,-b,-i,-u," +
"span[data-mce-type],hr",
这里的重要事项是'P'和'span'元素之前没有减号。