允许链接在tinymce中

时间:2012-02-29 00:20:38

标签: tinymce

我一直在搜索这几个小时,我甚至在这里看过这个问题,但它似乎对我不起作用: TinyMce Allow all Html tag

我希望能够编写像

这样的链接
<a href="www.google.com">Google</a>

直接在编辑器中。我正在使用

valid_elements : "*[*]",

但它仍然无效。我该怎么办?

1 个答案:

答案 0 :(得分:1)

我不确定,但设置 []似乎不够。您还可以查看valid_children设置。

这是我使用的(也要注意设置属性):

    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",

    valid_children: "body[p|ol|ul]" +
    ",p[a|span|b|i|u|sup|sub|img|hr|#text]" +
    ",span[p|a|b|i|u|sup|sub|img|#text]" +
    ",a[span|b|i|u|sup|sub|img|#text]" +
    ",b[span|a|i|u|sup|sub|img|#text]" +
    ",i[span|a|b|u|sup|sub|img|#text]" +
    ",sup[span|a|i|b|u|sub|img|#text]" +
    ",sub[span|a|i|b|u|sup|img|#text]" +
    ",li[span|a|b|i|u|sup|sub|img|ol|ul|#text]" +
    ",ol[li]" +
    ",ul[li]",