UBB 转换函数演示 (经典论坛)(8)

re.Pattern="(\[i\])(.*?)(\[\/i\])"
 strContent=re.Replace(strContent,"<i>$2</i>")
 re.Pattern="(\[u\])(.*?)(\[\/u\])"
 strContent=re.Replace(strContent,"<u>$2</u>")
 re.Pattern="(\[b\])(.*?)(\[\/b\])"
 strContent=re.Replace(strContent,"<b>$2</b>")

re.Pattern="(\[size=1\])(.*?)(\[\/size\])"
 strContent=re.Replace(strContent,"<font size=1line-height:"&FontHeight&"pt"">$2</font>")
 re.Pattern="(\[size=2\])(.*?)(\[\/size\])"
 strContent=re.Replace(strContent,"<font size=2line-height:"&FontHeight&"pt"">$2</font>")
 re.Pattern="(\[size=3\])(.*?)(\[\/size\])"
 strContent=re.Replace(strContent,"<font size=5line-height:"&FontHeight&"pt"">$2</font>")
 re.Pattern="(\[size=4\])(.*?)(\[\/size\])"
 strContent=re.Replace(strContent,"<font size=6line-height:"&FontHeight&"pt"">$2</font>")

 re.Pattern="\[size=([+|-]?[0-7])\](.*?)(\[\/size\])"
 strContent=re.Replace(strContent,"<font size=https://www.jb51.net/article/$1line-height:"&FontHeight&"pt"">$2</font>")

re.Pattern="(\[center\])(.*?)(\[\/center\])"
 strContent=re.Replace(strContent,"<center>$2</center>")

re.Pattern="(\[table=(#*[a-z0-9]*),(#*[a-z0-9]*),(#*[a-z0-9]*)\])(.*?)(\[\/table\])"
 strContent=re.Replace(strContent,"<table border=0 cellpadding=5 cellspacing=1 bgcolor=https://www.jb51.net/article/$2><tr><td bgcolor=https://www.jb51.net/article/$3><font color=https://www.jb51.net/article/$4>$5</font></td></tr></table>")

'{HTML} start
 're.Pattern="(\[html\])(.*?)(\[\/html\])"
 'strContent=re.Replace(strContent,"<span><TEXTAREA cols=95 rows=12>$2</TEXTAREA><br><INPUT onclick=runCode() type=button value=运行代码>[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]</span>")
       

'{/HTML}end  
 


 set re=Nothing
 gmt=strContent
end function

</script>


内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wfzzgd.html