don't link missing mentions
This commit is contained in:
parent
7cb9c093c0
commit
3cfdaacdb3
6
fun.go
6
fun.go
|
@ -181,7 +181,11 @@ func obfusbreak(s string) string {
|
||||||
|
|
||||||
s = strings.Replace(s, "\n", "<br>", -1)
|
s = strings.Replace(s, "\n", "<br>", -1)
|
||||||
s = re_mentions.ReplaceAllStringFunc(s, func(m string) string {
|
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))
|
html.EscapeString(m))
|
||||||
})
|
})
|
||||||
return s
|
return s
|
||||||
|
|
Loading…
Reference in New Issue