all repos — honk @ 455699bae42b2eb7a7a12d1a024a7c5851457d5c

my fork of honk

don't link missing mentions
Ted Unangst tedu@tedunangst.com
Mon, 15 Apr 2019 23:48:01 -0400
commit

455699bae42b2eb7a7a12d1a024a7c5851457d5c

parent

dd75003f3b2098015ffc98bd8d6289142ac39e04

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M fun.gofun.go

@@ -181,7 +181,11 @@ s = re_link.ReplaceAllStringFunc(s, linkfn)

s = strings.Replace(s, "\n", "<br>", -1) s = re_mentions.ReplaceAllStringFunc(s, func(m string) string { - return fmt.Sprintf(`<a href="%s">%s</a>`, html.EscapeString(gofish(m)), + where := gofish(m) + if where == "" { + return m + } + return fmt.Sprintf(`<a href="%s">%s</a>`, html.EscapeString(where), html.EscapeString(m)) }) return s