unybb.js

来自「1. 硬件环境:MS WINDOWS NT PACK 4 OR LATER /W」· JavaScript 代码 · 共 28 行

JS
28
字号
function unybbcode(temp) {
temp = temp.replace(/<br>/ig,"\n");
temp = temp.replace(/<b>(.[^\[]*)<\/b>/ig,"\[b\]$1\[\/b\]");
temp = temp.replace(/<i>(.[^\[]*)<\/i>/ig,"\[i\]$1\[\/i\]");
temp = temp.replace(/<u>(.[^\[]*)<\/u>/ig,"\[u\]$1\[\/u\]");
temp = temp.replace(/<strike>(.[^\[]*)<\/strike>/ig,"\[strike\]$1\[\/strike\]");
temp = temp.replace(/<center>(.[^\[]*)<\/center>/ig,"\[center\]$1\[\/center\]");

temp = temp.replace(/<marquee>(.[^\[]*)<\/marquee>/ig,"\[fly\]$1\[\/fly\]");

temp = temp.replace(/<marquee>(.[^\[]*)<\/marquee>/ig,"\[marquee\]$1\[\/marquee\]");
temp = temp.replace(/<A TARGET=_blank HREF="(.[^\[]*)">(.[^\[]*)<\/A>/ig,"[URL=$1\]$2\[\/URL\]");
temp = temp.replace(/ onload=\"javascript:if(.*)this.width=screen.width-300\"/ig,"");
temp = temp.replace(/<img border=0 src=(http:\/\/.\S+)>/ig,"[IMG\]$1\[\/IMG\]");
temp = temp.replace(/<img border=0 src=(.\S+)>/ig,"[IMG\]$1\[\/IMG\]");
temp = temp.replace(/<embed src=(http:\/\/.\S+) width=560 height=420>/ig,"[FLASH\]$1\[\/FLASH\]");
temp = temp.replace(/<a href=mailto:(\w+\@\w+.[\w.]+)>(\w+\@\w+.[\w.]+)<\/a>/ig,"[EMAIL\]$1\[\/EMAIL\]");
temp = temp.replace(/<FONT face="([^.:;`'"=]+)">(.[^\[]*)<\/FONT>/ig,"[font=$1\]$2\[\/font\]");
temp = temp.replace(/<FONT size="([^.:;`'"=]+)">(.[^\[]*)<\/FONT>/ig,"[size=$1\]$2\[\/size\]");
temp = temp.replace(/<FONT COLOR="([^.:;`'"=]+)">(.[^\[]*)<\/FONT>/ig,"[COLOR=$1\]$2\[\/COLOR\]");
temp = temp.replace(/<BLOCKQUOTE><strong>引用<\/strong>:<HR Size=1>(.[^\[]*)<HR SIZE=1><\/BLOCKQUOTE>/ig,"\[QUOTE\]$1\[\/QUOTE\]");
temp = temp.replace(/<BLOCKQUOTE><strong>代码<\/strong>:<HR Size=1>(.[^\[]*)<HR SIZE=1><\/BLOCKQUOTE>/ig,"\[CODE\]$1\[\/CODE\]");
temp = temp.replace(/<BLOCKQUOTE>/ig,"\[QUOTE\]");
temp = temp.replace(/<\/BLOCKQUOTE>/ig,"\[\/QUOTE\]");
temp = temp.replace(/<(.[^\[]*)>/ig,"");
return (temp);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?