From 0a3515268cd4ba61113c8e7de70a6016bc83992f Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 1 May 2023 14:27:39 -0400 Subject: [PATCH] be a bit more permissive with the quick mentions --- fun.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fun.go b/fun.go index d168ef1..af41b87 100644 --- a/fun.go +++ b/fun.go @@ -463,7 +463,7 @@ func memetize(honk *Honk) { honk.Noise = re_memes.ReplaceAllStringFunc(honk.Noise, repl) } -var re_quickmention = regexp.MustCompile("(^|[ \n])@[[:alnum:]]+([ \n.,']|$)") +var re_quickmention = regexp.MustCompile("(^|[ \n])@[[:alnum:]_]+([ \n:;.,']|$)") func quickrename(s string, userid int64) string { nonstop := true @@ -479,6 +479,7 @@ func quickrename(s string, userid int64) string { m = m[1:] tail := "" if last := m[len(m)-1]; last == ' ' || last == '\n' || + last == ':' || last == ';' || last == '.' || last == ',' || last == '\'' { tail = m[len(m)-1:] m = m[:len(m)-1]