support hashtags in bios
This commit is contained in:
parent
f6995ce94e
commit
d6ade574f0
13
activity.go
13
activity.go
|
@ -1418,6 +1418,19 @@ func junkuser(user *WhatAbout) junk.Junk {
|
||||||
j["name"] = user.Display
|
j["name"] = user.Display
|
||||||
j["preferredUsername"] = user.Name
|
j["preferredUsername"] = user.Name
|
||||||
j["summary"] = user.HTAbout
|
j["summary"] = user.HTAbout
|
||||||
|
var tags []junk.Junk
|
||||||
|
for _, o := range user.Onts {
|
||||||
|
t := junk.New()
|
||||||
|
t["type"] = "Hashtag"
|
||||||
|
o = strings.ToLower(o)
|
||||||
|
t["href"] = fmt.Sprintf("https://%s/o/%s", serverName, o[1:])
|
||||||
|
t["name"] = o
|
||||||
|
tags = append(tags, t)
|
||||||
|
}
|
||||||
|
if len(tags) > 0 {
|
||||||
|
j["tag"] = tags
|
||||||
|
}
|
||||||
|
|
||||||
if user.ID > 0 {
|
if user.ID > 0 {
|
||||||
j["type"] = "Person"
|
j["type"] = "Person"
|
||||||
j["url"] = user.URL
|
j["url"] = user.URL
|
||||||
|
|
|
@ -59,6 +59,7 @@ func userfromrow(row *sql.Row) (*WhatAbout, error) {
|
||||||
marker.HashLinker = ontoreplacer
|
marker.HashLinker = ontoreplacer
|
||||||
marker.AtLinker = attoreplacer
|
marker.AtLinker = attoreplacer
|
||||||
user.HTAbout = template.HTML(marker.Mark(user.About))
|
user.HTAbout = template.HTML(marker.Mark(user.About))
|
||||||
|
user.Onts = marker.HashTags
|
||||||
|
|
||||||
return user, nil
|
return user, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue