translate chat to html
Ted Unangst tedu@tedunangst.com
Thu, 14 May 2020 23:06:23 -0400
3 files changed,
7 insertions(+),
2 deletions(-)
M
activity.go
→
activity.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.go
→
fun.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:])