我已经在我的tinymce.init中将a[name|href|target|title|onclick|id]
添加到extended_valid_elements
,但<a href="#"></a>
仍被过滤掉。
我应该编辑核心.js还是我在初始化设置中遗漏了什么?
编辑: 这是Orchard上TinyMCE的默认配置:
tinyMCE.init({
theme: "advanced",
mode: "specific_textareas",
editor_selector: "tinymce",
plugins: "fullscreen,searchreplace,mediapicker",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_buttons1: "search,replace,|,cut,copy,paste,|,undo,redo,|,mediapicker,|,link,unlink,charmap,emoticon,codeblock,|,bold,italic,|,numlist,bullist,formatselect,|,code,fullscreen",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
convert_urls: false,
valid_elements: "*[*]",
// shouldn't be needed due to the valid_elements setting, but TinyMCE would strip script.src without it.
extended_valid_elements: "script[type|defer|src|language]"
});
答案 0 :(得分:1)
遇到类似的问题,我发布了我的答案,万一其他人会遇到它 -
在TinyMCE 4.0.9或更高版本中,有一个名为:
的密钥allow_script_urls:true;
您可以将其设置为true,然后就可以了。