From b76f377ca946db49e471e6f4a1f0afc75473ab6b Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 29 Nov 2019 14:53:25 -0500 Subject: [PATCH] quick mention should allow trailing . --- fun.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fun.go b/fun.go index 577bd40..f2e959b 100644 --- a/fun.go +++ b/fun.go @@ -374,7 +374,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 @@ -389,7 +389,7 @@ func quickrename(s string, userid int64) string { prefix += "@" m = m[1:] tail := "" - if m[len(m)-1] == ' ' || m[len(m)-1] == '\n' { + if last := m[len(m)-1]; last == ' ' || last == '\n' || last == '.' { tail = m[len(m)-1:] m = m[:len(m)-1] }