有没有办法得到TinyMCE V4不删除 <style>
标签。
tinymce.init({
selector: 'textarea.tinymce',
theme: 'modern',
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor'
],
valid_elements: '+*[*]',
width: '100%',
inline_styles: true,
keep_styles: true,
extended_valid_elements: '+*[*]',
custom_elements: '*',
invalid_elements: '',
verify_html: false
});
我希望能够添加任何我想要的 HTML,无论是否有效。我不在乎它是 fork 还是解决方法。
最佳答案
您可以为此使用 TinyMCE 的 valid_children
选项:
valid_children : '+body[style]',
检查 this fiddle一个完整的例子。
valid_children
使您能够控制指定父元素中可以存在哪些子元素。
关于javascript - TinyMCE 剥离样式标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38165362/