translate chat to html
This commit is contained in:
parent
3b792bbcea
commit
b7ec6b50d8
|
@ -1287,7 +1287,7 @@ func sendchonk(user *WhatAbout, ch *Chonk) {
|
||||||
jo["published"] = dt
|
jo["published"] = dt
|
||||||
jo["attributedTo"] = user.URL
|
jo["attributedTo"] = user.URL
|
||||||
jo["to"] = aud
|
jo["to"] = aud
|
||||||
jo["content"] = ch.Noise
|
jo["content"] = ch.HTML
|
||||||
|
|
||||||
j := junk.New()
|
j := junk.New()
|
||||||
j["@context"] = itiswhatitis
|
j["@context"] = itiswhatitis
|
||||||
|
|
6
fun.go
6
fun.go
|
@ -182,7 +182,11 @@ func filterchonk(ch *Chonk) {
|
||||||
var htf htfilter.Filter
|
var htf htfilter.Filter
|
||||||
htf.SpanClasses = allowedclasses
|
htf.SpanClasses = allowedclasses
|
||||||
htf.BaseURL, _ = url.Parse(ch.XID)
|
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)
|
n := string(ch.HTML)
|
||||||
if strings.HasPrefix(n, "<p>") {
|
if strings.HasPrefix(n, "<p>") {
|
||||||
ch.HTML = template.HTML(n[3:])
|
ch.HTML = template.HTML(n[3:])
|
||||||
|
|
Loading…
Reference in New Issue