From 3cfdaacdb3b99373bd95b40ff6d34baecdf484a2 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 15 Apr 2019 23:48:01 -0400 Subject: [PATCH] don't link missing mentions --- fun.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fun.go b/fun.go index 471f479..c1dc5ae 100644 --- a/fun.go +++ b/fun.go @@ -181,7 +181,11 @@ func obfusbreak(s string) string { s = strings.Replace(s, "\n", "
", -1) s = re_mentions.ReplaceAllStringFunc(s, func(m string) string { - return fmt.Sprintf(`%s`, html.EscapeString(gofish(m)), + where := gofish(m) + if where == "" { + return m + } + return fmt.Sprintf(`%s`, html.EscapeString(where), html.EscapeString(m)) }) return s