From 8db68f9427e7adbef3d36a0e23ffb10d7d660168 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Sun, 28 Mar 2021 00:11:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cqcode=20fix=20url=20=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E5=86=99=E7=9A=84=E6=97=B6=E5=80=99=E6=86=A8=E6=89=B9=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coolq/cqcode.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/coolq/cqcode.go b/coolq/cqcode.go index 3f8c160..e27b82f 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -443,7 +443,13 @@ S1: // Plain Text if *(*byte)(add(ptr, uintptr(i))) == '[' && i+4 < l && *(*uint32)(add(ptr, uintptr(i))) == magicCQ { // Magic :uint32([]byte("[CQ:")) if i > j { - r = append(r, message.NewText(CQCodeUnescapeText(s[j:i]))) + if SplitURL { + for _, str := range global.SplitURL(CQCodeUnescapeText(s[j:i])) { + r = append(r, message.NewText(str)) + } + } else { + r = append(r, message.NewText(CQCodeUnescapeText(s[j:i]))) + } } CQBegin = i i += 4 @@ -501,7 +507,13 @@ S4: // CQCode param value goto End End: if i > j { - r = append(r, message.NewText(CQCodeUnescapeText(s[j:i]))) + if SplitURL { + for _, str := range global.SplitURL(CQCodeUnescapeText(s[j:i])) { + r = append(r, message.NewText(str)) + } + } else { + r = append(r, message.NewText(CQCodeUnescapeText(s[j:i]))) + } } return }