From aeef98d18bfe892cbff8eba91889aa1b02b9e8fa Mon Sep 17 00:00:00 2001 From: shylinux Date: Mon, 27 Mar 2023 21:23:10 +0800 Subject: [PATCH] opt base --- lib/date.js | 1 + plugin/local/code/inner.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/date.js b/lib/date.js index ca538693..6538bafc 100644 --- a/lib/date.js +++ b/lib/date.js @@ -250,3 +250,4 @@ Volcanos("date", { // @1900-2100区间内的公历转农历 '7f07e7f0e47f531b0723b0b6fb0721','7f0e26665b66a449801e9808297c35','665f67f0e37f1489801eb072297c35', '7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722'], }) +Volcanos("page", {trans: function(can, text) { return can.base.replaceAll(text, "<", "<", ">", ">") }}) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index f20003f3..0045a211 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -275,7 +275,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { }, can.ui._content.parentNode) }, _parse: function(can, line) { - function wrap(text, type) { return can.page.Format(html.SPAN, text, type) } + function wrap(text, type) { return can.page.Format(html.SPAN, can.page.trans(can, text), type) } var p = can.onsyntax[can.db.parse]||{}; p = can.onsyntax[p.link]||p, p.split = p.split||{} if (p.prefix && can.core.Item(p.prefix, function(pre, type) { if (can.base.beginWith(line, pre)) { return line = wrap(line, type) } }).length > 0) { return line } if (p.suffix && can.core.Item(p.suffix, function(end, type) { if (can.base.endWith(line, end)) { return line = wrap(line, type) } }).length > 0) { return line }