function htmltoubb() { hightout(pattern($("#content").val())) } function ubbtohtml() { hightout(up($("#content").val())) } function pattern(str) { str = str.replace(/
]*>/ig, '\n'); str = str.replace(/
\/]*\/>/ig, '\n'); str = str.replace(/\son[\w]{3,16}\s?=\s*([\'\"]).+?\1/ig, ''); str = str.replace(/
'); str = str.replace(/\[size=(\d+?)\]/ig, ''); str = str.replace(/\[color=([^\[\<]+?)\]/ig, ''); str = str.replace(/\[backcolor=([^\[\<]+?)\]/ig, ''); str = str.replace(/\[font=([^\[\<]+?)\]/ig, ''); str = str.replace(/\[list=(a|A|1)\](.+?)\[\/list\]/ig, '$2
'); str = str.replace(/\[(\/)?list\]/ig, '<$1ul>'); str = str.replace(/\[s:(\d+)\]/ig, function ($1, $2) { return smilepath($2) }); str = str.replace(/\[img\]([^\[]*)\[\/img\]/ig, ''); str = str.replace(/\[url=([^\]]+)\]([^\[]+)\[\/url\]/ig, '$2'); str = str.replace(/\[url\]([^\[]+)\[\/url\]/ig, '$1'); return str }