Tinymce编辑器生成文本颜色和背景颜色变化但不发送的HTML代码

时间:2017-04-07 17:29:09

标签: javascript tinymce

我在我的Laravel应用程序中使用Tinymce编辑器。一切都工作正常,但当我改变任何文字的颜色或背景颜色时会遇到一些问题。

Trying to do the following 它正在生成html,但在我提交时却没有发送 enter image description here 初始化如下:

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' },
        ],
    });

当我调试输出时,它显示以下内容: enter image description here

1 个答案:

答案 0 :(得分:0)

我得到了我的解决方案:如果我设置了

,它就可以了
tinymce.init({
     extended_valid_elements: true,
     //or
     extended_valid_elements: 'a[href|target=_blank]',
});