我在我的Laravel应用程序中使用Tinymce编辑器。一切都工作正常,但当我改变任何文字的颜色或背景颜色时会遇到一些问题。
tinymce.init({
selector: '#description',
extended_valid_elements : 'span',
verify_html: true,
height: 400,
theme: 'modern',
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc'
],
toolbar1: 'undo redo | insert | styleselect | fontselect fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
toolbar2: 'print preview media | forecolor backcolor emoticons | codesample | mybutton',
image_advtab: true,
image_title: true,
image_caption: true,
relative_urls: false,
theme_advanced_buttons1: "forecolor,backcolor,fontselect,fontsizeselect",
templates: [
{ title: 'Test template 1', content: 'Test 1' },
{ title: 'Test template 2', content: 'Test 2' },
],
});
答案 0 :(得分:0)
我得到了我的解决方案:如果我设置了
,它就可以了tinymce.init({
extended_valid_elements: true,
//or
extended_valid_elements: 'a[href|target=_blank]',
});