开发者

TinyMCE and BBCode plugin

开发者 https://www.devze.com 2023-04-12 14:59 出处:网络
I am trying to implement tinyMCE\'s BBCode plugin but not being able to make it work. This is the init code:

I am trying to implement tinyMCE's BBCode plugin but not being able to make it work. This is the init code:

$(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_lin开发者_高级运维ebreaks : 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'
});

The thing is that when I submit the form, HTML tags are being posted instead of BBCode. If I try tinyMCE.activeEditor.getContent() on the console, it brings BBCode.

I'm using an input[type=submit] to send the form (without any JS attached to it).

Why am I not getting BBCode posted?


Try passing the textarea content by a htmlentities function before sending it to the file that will handle the data!

0

精彩评论

暂无评论...
验证码 换一张
取 消