From 96dd3f4f8ed2a31f63cd44bbe2eeb882113319d9 Mon Sep 17 00:00:00 2001 From: polaris <2673986789@qq.com> Date: Sat, 30 Nov 2024 14:14:56 +0800 Subject: [PATCH] fix: rename reHole as reMention to avoid declaration reHole twice --- models/notification.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/notification.go b/models/notification.go index fde825a..03a4dd2 100644 --- a/models/notification.go +++ b/models/notification.go @@ -266,14 +266,14 @@ func UpdateAdminList(ctx context.Context) { } var ( - reHole = regexp.MustCompile(`#{1,2}\d+`) + reMention = regexp.MustCompile(`#{1,2}\d+`) reFormula = regexp.MustCompile(`(?s)\${1,2}.*?\${1,2}`) reSticker = regexp.MustCompile(`!\[\]\(dx_\S+\)`) reImage = regexp.MustCompile(`!\[.*?\]\(.*?\)`) ) func cleanNotificationDescription(content string) string { - newContent := reHole.ReplaceAllString(content, "") + newContent := reMention.ReplaceAllString(content, "") newContent = reFormula.ReplaceAllString(newContent, "[公式]") newContent = reSticker.ReplaceAllString(newContent, "[表情]") newContent = reImage.ReplaceAllString(newContent, "[图片]")