tags:

views:

292

answers:

1

Hi,

After the person submits the form using tinymce, is it possible for tinyMCE to not return any HTML, but rather bbcode type tags? i.e. [blah][/blah] etc?

+3  A: 

Yes, it has a bundled plugin for that.

tinyMCE.init({
    theme : "advanced",
    mode : "textareas",
    plugins : "bbcode",
    theme_advanced_buttons1 : "bold,italic,undo,redo,link,unlink,image,cleanup",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "bottom",
    theme_advanced_toolbar_align : "center",
    theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
    content_css : "bbcode.css",
    entity_encoding : "raw",
    add_unload_trigger : false,
    remove_linebreaks : false
});
çağdaş
very cool, so basically I just have to do the regex on the server-side to handle the bbcode, and I can safely escape everything else since it doesn't have to do with the real formatting!
mrblah