]*>/gi,"[quote]");
rep(/<\/blockquote>/gi,"[/quote]");
rep(/
/gi,"\n");
rep(/
/gi,"\n");
rep(/
/gi,"\n");
rep(//gi,"");
rep(/<\/p>/gi,"\n");
rep(/ /gi," ");
rep(/"/gi,"\"");
rep(/</gi,"<");
rep(/>/gi,">");
rep(/&/gi,"&");
return s;
},
// BBCode -> HTML from PunBB dialect
_punbb_bbcode2html : function(s) {
s = tinymce.trim(s);
function rep(re, str) {
s = s.replace(re, str);
};
// example: [b] to
rep(/\n/gi,"
");
rep(/\[b\]/gi,"");
rep(/\[\/b\]/gi,"");
rep(/\[i\]/gi,"");
rep(/\[\/i\]/gi,"");
rep(/\[u\]/gi,"");
rep(/\[\/u\]/gi,"");
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2");
rep(/\[url\](.*?)\[\/url\]/gi,"$1");
rep(/\[img\](.*?)\[\/img\]/gi,"
");
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2");
rep(/\[code\](.*?)\[\/code\]/gi,"$1 ");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 ");
return s;
}
});
// Register plugin
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
})();