马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?快速注册
×
[code]/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: bbcode.js 19432 2010-12-31 03:57:14Z monkey $
*/
var re;
function addslashes(str) {
return preg_replace(['\\\\', '\\\'', '\\\/', '\\\(', '\\\)', '\\\[', '\\\]', '\\\{', '\\\}', '\\\^', '\\\
, '\\\?', '\\\.', '\\\*', '\\\+', '\\\|'], ['\\\\', '\\\'', '\\/', '\\(', '\\)', '\\[', '\\]', '\\{', '\\}', '\\^', '\\
, '\\?', '\\.', '\\*', '\\+', '\\|'], str);
}
function atag(aoptions, text) {
if(trim(text) == '') {
return '';
}
var pend = parsestyle(aoptions, '', '');
href = getoptionvalue('href', aoptions);
if(href.substr(0, 11) == 'javascript:') {
return trim(recursion('a', text, 'atag'));
}
return pend['prepend'] + '[url=' + href + ']' + trim(recursion('a', text, 'atag')) + '[/url]' + pend['append'];
}
function bbcode2html(str) {
if(str == '') {
return '';
}
if(!fetchCheckbox('bbcodeoff') && allowbbcode) {
str = str.replace(/\[code\]([\s\S]+?)\[\/code\]/ig, function($1, $2) {return parsecode($2);});
}
if(!allowhtml || !fetchCheckbox('htmlon')) {
str = str.replace(/</g, '<');
str = str.replace(/>/g, '>');
if(!fetchCheckbox('parseurloff')) {
str = parseurl(str, 'html', false);
}
}
if(!fetchCheckbox('smileyoff') && allowsmilies) {
if(typeof smilies_type == 'object') {
for(var typeid in smilies_array) {
for(var page in smilies_array[typeid]) {
for(var i in smilies_array[typeid] |