incrementally closer to consistent html processing

This commit is contained in:
Ted Unangst 2019-10-29 16:24:32 -04:00
parent f97692c875
commit 295f558560
2 changed files with 7 additions and 4 deletions

View File

@ -1013,10 +1013,10 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
if !h.Public {
jo["directMessage"] = true
}
mentions := bunchofgrapes(h.Noise)
translate(h, true)
h.Noise = re_memes.ReplaceAllString(h.Noise, "")
jo["summary"] = html.EscapeString(h.Precis)
jo["content"] = ontologize(mentionize(h.Noise))
jo["content"] = h.Noise
if strings.HasPrefix(h.Precis, "DZ:") {
jo["sensitive"] = true
}
@ -1034,7 +1034,7 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
}
var tags []junk.Junk
for _, m := range bunchofgrapes(h.Noise) {
for _, m := range mentions {
t := junk.New()
t["type"] = "Mention"
t["name"] = m.who

5
fun.go
View File

@ -220,7 +220,6 @@ func translate(honk *Honk, redoimages bool) {
n, _ := htf.String(honk.Noise)
honk.Precis = string(p)
honk.Noise = string(n)
honk.Noise = strings.Replace(honk.Noise, "<a href=", "<a class=\"mention u-url\" href=", -1)
}
j := 0
for i := 0; i < len(honk.Donks); i++ {
@ -230,6 +229,10 @@ func translate(honk *Honk, redoimages bool) {
}
}
honk.Donks = honk.Donks[:j]
honk.Noise = re_memes.ReplaceAllString(honk.Noise, "")
honk.Noise = ontologize(mentionize(honk.Noise))
honk.Noise = strings.Replace(honk.Noise, "<a href=", "<a class=\"mention u-url\" href=", -1)
}
}