quick mention should allow trailing .

This commit is contained in:
Ted Unangst 2019-11-29 14:53:25 -05:00
parent a50115d65f
commit b76f377ca9
1 changed files with 2 additions and 2 deletions

4
fun.go
View File

@ -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]
}