From 0928803a34c3a8e2f595ae29d127d9b4d450d565 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Sat, 24 Feb 2024 13:37:53 +0000 Subject: [PATCH] remove emoji strings from display name --- internal/utilities/utilities.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/utilities/utilities.go b/internal/utilities/utilities.go index 6a71c38..69f5e56 100644 --- a/internal/utilities/utilities.go +++ b/internal/utilities/utilities.go @@ -1,6 +1,7 @@ package utilities import ( + "regexp" "strings" "time" "unicode" @@ -63,7 +64,10 @@ func FieldFormat(text string) string { } func DisplayNameFormat(text string) string { - return boldmagenta + text + reset + // use this pattern to remove all emoji strings + pattern := regexp.MustCompile(`\s:[A-Za-z0-9]*:`) + + return boldmagenta + pattern.ReplaceAllString(text, "") + reset } func FormatDate(date time.Time) string {