all repos — honk @ efd5ee4d633e31b812cc607b7f38af9d8237c248

my fork of honk

consistently process precis as html.
only do the markdown conversion once and early.
Ted Unangst tedu@tedunangst.com
Thu, 23 Feb 2023 18:19:37 -0500
commit

efd5ee4d633e31b812cc607b7f38af9d8237c248

parent

65b6bc8a0926c5433125249de518bc2c81b94572

3 files changed, 12 insertions(+), 5 deletions(-)

jump to
M activity.goactivity.go

@@ -1290,7 +1290,7 @@ atts := activatedonks(h.Donks)

if len(atts) > 0 { jo["attachment"] = atts } - jo["summary"] = html.EscapeString(h.Precis) + jo["summary"] = h.Precis jo["content"] = h.Noise j["object"] = jo case "bonk":
M fun.gofun.go

@@ -289,10 +289,7 @@ }

var re_dangerous = regexp.MustCompile("^[a-zA-Z]{2}:") -func translate(honk *Honk) { - if honk.Format == "html" { - return - } +func precipitate(honk *Honk) { noise := honk.Noise if re_dangerous.MatchString(noise) { idx := strings.Index(noise, "\n")

@@ -305,6 +302,14 @@ noise = noise[idx+1:]

} } honk.Precis = markitzero(strings.TrimSpace(honk.Precis)) + honk.Noise = noise +} + +func translate(honk *Honk) { + if honk.Format == "html" { + return + } + noise := honk.Noise var marker mz.Marker marker.HashLinker = ontoreplacer
M web.goweb.go

@@ -1620,6 +1620,8 @@ noise = strings.Replace(noise, "\r", "", -1)

noise = quickrename(noise, userinfo.UserID) noise = hooterize(noise) honk.Noise = noise + precipitate(honk) + noise = honk.Noise translate(honk) var convoy string