我使用tinymce编辑器,我有这个代码:
tinymce.init({
selector: ".edytor"
});
我想从编辑器中删除这些选项:
我该怎么做?
答案 0 :(得分:0)
您需要将tinymce配置为仅允许段落:
forced_root_block: 'p',
valid_elements: "@[id|class|title|style],"
+ "a[name|href|target|title|alt],"
+ "#p,-ol,-ul,-li,br,img[src|unselectable],-sub,-sup,-b,-i,-u,"
+ "-span[data-mce-type],hr",
valid_child_elements : "body[p,ol,ul]"
+ ",p[a|span|b|i|u|sup|sub|img|hr|#text]"
+ ",span[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]",
另外,您需要覆盖默认的tinymce格式。 请查看此tinymce文档页面以了解更多信息:http://www.tinymce.com/wiki.php/Configuration:formats