TinyMCE和BBCode插件

4

我正在尝试实现tinyMCE的BBCode插件,但无法使其正常工作。 这是初始化代码:

$(textarea).tinymce({
    script_url : '/js/tiny_mce/tiny_mce.js',
    theme : "advanced",
    plugins : "bbcode",
    theme_advanced_buttons1 : "bold,italic,underline,forecolor,|,undo,redo,link,unlink,|,removeformat,cleanup",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
    entity_encoding : "raw",
    remove_linebreaks : false,
    forced_root_block : false,
    force_br_newlines : true,
    force_p_newlines : false,    
    convert_newlines_to_brs : true,
    remove_redundant_brs : false,
    width: '700px',
    height: '250px'
});

问题在于当我提交表单时,HTML标签被发布而不是BBCode。如果我在控制台上尝试tinyMCE.activeEditor.getContent(),它会带来BBCode。

我正在使用发送表单(没有任何JS附加到它上面)。

为什么我没有发布BBCode?

1个回答

0
尝试在将文本区域内容发送到处理数据的文件之前,通过 htmlentities 函数传递它!

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接