1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
shaoying 2022-12-04 09:17:24 +08:00
parent a8fd58f4e7
commit 5e44892381

View File

@ -185,7 +185,7 @@ Volcanos("page", {ClassList: {
case html.SPAN: return args[2]? "<span class='"+args[2]+"'>"+args[1]+"</span>": args[1] case html.SPAN: return args[2]? "<span class='"+args[2]+"'>"+args[1]+"</span>": args[1]
} }, } },
Color: function(text) { if (typeof text != lang.STRING) { return "" } text = text.replace(/\\n/g, "<br>") Color: function(text) { if (typeof text != lang.STRING) { return "" } text = text.replace(/\\n/g, "<br>")
if (text.indexOf(ice.HTTP) == 0) { var ls = text.split(ice.SP); text = "<a href='"+ls[0]+"' target='_blank'>"+ls[0]+"</a>"+ls.slice(1).join(ice.SP) } if (text.indexOf(ice.HTTP) == 0 && text.length > 10) { var ls = text.split(ice.SP); text = "<a href='"+ls[0]+"' target='_blank'>"+ls[0]+"</a>"+ls.slice(1).join(ice.SP) }
if (text.indexOf("\033\[") == -1) { return text } if (text.indexOf("\033\[") == -1) { return text }
text = text.replace(/\033\[31m/g, "<span style='color:#f00'>") text = text.replace(/\033\[31m/g, "<span style='color:#f00'>")
text = text.replace(/\033\[32m/g, "<span style='color:#0f0'>") text = text.replace(/\033\[32m/g, "<span style='color:#0f0'>")