all repos — honk @ a774192626249641eb7fad08ccfe075046f74396

my fork of honk

just be explicit about match checking
Ted Unangst tedu@tedunangst.com
Fri, 03 Feb 2023 22:48:19 -0500
commit

a774192626249641eb7fad08ccfe075046f74396

parent

8f140d517f7b30633ba0a2e0788c7643d5c27909

1 files changed, 2 insertions(+), 3 deletions(-)

jump to
M fun.gofun.go

@@ -27,7 +27,6 @@ "os"

"regexp" "strings" "time" - "unicode" "golang.org/x/net/html" "humungus.tedunangst.com/r/webs/cache"

@@ -458,7 +457,6 @@ }

honk.Noise = re_memes.ReplaceAllStringFunc(honk.Noise, repl) } -// be mindful not to match trailing @ var re_quickmention = regexp.MustCompile("(^|[ \n])@[[:alnum:]]+([ \n.,']|$)") func quickrename(s string, userid int64) string {

@@ -474,7 +472,8 @@ }

prefix += "@" m = m[1:] tail := "" - if last := m[len(m)-1]; last == ' ' || last == '\n' || unicode.IsPunct(rune(last)) { + if last := m[len(m)-1]; last == ' ' || last == '\n' || + last == '.' || last == ',' || last == '\'' { tail = m[len(m)-1:] m = m[:len(m)-1] }