be a bit more permissive with the quick mentions

This commit is contained in:
Ted Unangst 2023-05-01 14:27:39 -04:00
parent e212f4eb1e
commit 0a3515268c
1 changed files with 2 additions and 1 deletions

3
fun.go
View File

@ -463,7 +463,7 @@ func memetize(honk *Honk) {
honk.Noise = re_memes.ReplaceAllStringFunc(honk.Noise, repl) 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 { func quickrename(s string, userid int64) string {
nonstop := true nonstop := true
@ -479,6 +479,7 @@ func quickrename(s string, userid int64) string {
m = m[1:] m = m[1:]
tail := "" tail := ""
if last := m[len(m)-1]; last == ' ' || last == '\n' || if last := m[len(m)-1]; last == ' ' || last == '\n' ||
last == ':' || last == ';' ||
last == '.' || last == ',' || last == '\'' { last == '.' || last == ',' || last == '\'' {
tail = m[len(m)-1:] tail = m[len(m)-1:]
m = m[:len(m)-1] m = m[:len(m)-1]