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
3 files changed,
12 insertions(+),
5 deletions(-)
M
activity.go
→
activity.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.go
→
fun.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