最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ubb转换成html 代码
时间:2008-03-15 编辑:简简单单 来源:一聚教程网
function up(str){
str = str.replace(/
str = str.replace(/>/ig,'>');
str = str.replace(/n/ig,'
');
str = str.replace(/[code](.+?)[/code]/ig, function($1, $2) {return phpcode($2);});
str = str.replace(/[hr]/ig,'
');
str = str.replace(/[/(size|color|font|backcolor)]/ig,'');
str = str.replace(/[(sub|sup|u|i|strike|b|blockquote|li)]/ig,'<$1>');
str = str.replace(/[/(sub|sup|u|i|strike|b|blockquote|li)]/ig,'$1>');
str = str.replace(/[/align]/ig,'');
str = str.replace(/[(/)?h([1-6])]/ig,'<$1h$2>');
str = str.replace(/[align=(left|center|right|justify)]/ig,'
');
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;
}
function ubbtohtml(){
str = up(document.getElementById("ubbsource").value);
document.getElementById("htmlresult").value=str;
}
-
上一个: html转换成ubb 函数
-
下一个: 自动复制功能
相关文章
- python实现html代码转义转换的例子 12-18
- ubb转换成html 08-05
- HTML与UBB代码互相转换 07-19
- html转换成UBB代码 05-24
- ubb 转换成html代码 04-29
- ubb代码转化html代码 01-12