Skip to content

Commit

Permalink
fix: rename reHole as reMention to avoid declaration reHole twice
Browse files Browse the repository at this point in the history
  • Loading branch information
ppolariss committed Nov 30, 2024
1 parent 6d697ec commit 96dd3f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "[图片]")
Expand Down

0 comments on commit 96dd3f4

Please sign in to comment.