all repos — honk @ b9df16bbcfedd8eb3a7a03326dc8bdcd1fe803bb

my fork of honk

translate chat to html
Ted Unangst tedu@tedunangst.com
Thu, 14 May 2020 23:06:23 -0400
commit

b9df16bbcfedd8eb3a7a03326dc8bdcd1fe803bb

parent

864217dd3c8150e3a34ec2adff241afe12b698b4

3 files changed, 7 insertions(+), 2 deletions(-)

jump to
M activity.goactivity.go

@@ -1287,7 +1287,7 @@ jo["type"] = "ChatMessage"

jo["published"] = dt jo["attributedTo"] = user.URL jo["to"] = aud - jo["content"] = ch.Noise + jo["content"] = ch.HTML j := junk.New() j["@context"] = itiswhatitis
M fun.gofun.go

@@ -182,7 +182,11 @@ func filterchonk(ch *Chonk) {

var htf htfilter.Filter htf.SpanClasses = allowedclasses htf.BaseURL, _ = url.Parse(ch.XID) - ch.HTML, _ = htf.String(ch.Noise) + noise := ch.Noise + if ch.Format == "markdown" { + noise = markitzero(noise) + } + ch.HTML, _ = htf.String(noise) n := string(ch.HTML) if strings.HasPrefix(n, "<p>") { ch.HTML = template.HTML(n[3:])
M web.goweb.go

@@ -1814,6 +1814,7 @@ Date: dt,

Noise: noise, Format: format, } + filterchonk(&ch) savechonk(&ch) go sendchonk(user, &ch)