break down and make mentions look like other mentions

This commit is contained in:
Ted Unangst 2019-04-16 16:10:51 -04:00
parent f5709a9e84
commit 723ac49a0c
1 changed files with 3 additions and 2 deletions

5
fun.go
View File

@ -185,8 +185,9 @@ func obfusbreak(s string) string {
if where == "" {
return m
}
return fmt.Sprintf(`<a class="mention" href="%s">%s</a>`, html.EscapeString(where),
html.EscapeString(m))
who := m[0:1 + strings.IndexByte(m[1:], '@')]
return fmt.Sprintf(`<span class="h-card"><a class="u-url mention" href="%s">%s</a></span>`,
html.EscapeString(where), html.EscapeString(who))
})
return s
}