bump htfilter
Ted Unangst tedu@tedunangst.com
Tue, 22 Oct 2019 02:02:36 -0400
M
fun.go
→
fun.go
@@ -91,11 +91,11 @@ h.Open = "open"
zap := make(map[string]bool) { - filt := htfilter.New() - filt.Imager = replaceimgsand(zap, false) - filt.SpanClasses = allowedclasses - p, _ := filt.String(h.Precis) - n, _ := filt.String(h.Noise) + var htf htfilter.Filter + htf.Imager = replaceimgsand(zap, false) + htf.SpanClasses = allowedclasses + p, _ := htf.String(h.Precis) + n, _ := htf.String(h.Noise) h.Precis = string(p) h.Noise = string(n) }@@ -180,9 +180,9 @@ }
} func imaginate(honk *Honk) { - imgfilt := htfilter.New() - imgfilt.Imager = inlineimgsfor(honk) - imgfilt.String(honk.Noise) + var htf htfilter.Filter + htf.Imager = inlineimgsfor(honk) + htf.String(honk.Noise) } func translate(honk *Honk, redoimages bool) {@@ -211,11 +211,11 @@
if redoimages { zap := make(map[string]bool) { - filt := htfilter.New() - filt.Imager = replaceimgsand(zap, true) - filt.SpanClasses = allowedclasses - p, _ := filt.String(honk.Precis) - n, _ := filt.String(honk.Noise) + var htf htfilter.Filter + htf.Imager = replaceimgsand(zap, true) + htf.SpanClasses = allowedclasses + p, _ := htf.String(honk.Precis) + n, _ := htf.String(honk.Noise) honk.Precis = string(p) honk.Noise = string(n) }
M
go.mod
→
go.mod
@@ -10,7 +10,7 @@ github.com/rivo/uniseg v0.0.0-20190313204849-f699dde9c340 // indirect
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 golang.org/x/net v0.0.0-20190620200207-3b0461eec859 humungus.tedunangst.com/r/go-sqlite3 v1.1.3 - humungus.tedunangst.com/r/webs v0.6.17 + humungus.tedunangst.com/r/webs v0.6.18 ) go 1.11
M
go.sum
→
go.sum
@@ -36,3 +36,5 @@ humungus.tedunangst.com/r/go-sqlite3 v1.1.3 h1:G2N4wzDS0NbuvrZtQJhh4F+3X+s7BF8b9ga8k38geUI=
humungus.tedunangst.com/r/go-sqlite3 v1.1.3/go.mod h1:FtEEmQM7U2Ey1TuEEOyY1BmphTZnmiEjPsNLEAkpf/M= humungus.tedunangst.com/r/webs v0.6.17 h1:d9kyIeS9lRinJrToI+7O6SUUiE/dSI7ke1T/Kmbm70A= humungus.tedunangst.com/r/webs v0.6.17/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= +humungus.tedunangst.com/r/webs v0.6.18 h1:5bho2umHAyT+DUTxbO9pCB3nETvuT7dgcc+3/voopTY= +humungus.tedunangst.com/r/webs v0.6.18/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps=
M
hoot.go
→
hoot.go
@@ -78,7 +78,7 @@ }
wanted := wantmatch[1] var buf strings.Builder - filt := htfilter.New() + var htf htfilter.Filter fmt.Fprintf(&buf, "%s\n", url) for _, div := range divs { twp := div.Parent.Parent.Parent@@ -97,7 +97,7 @@ author := authormatch[1]
if author != wanted { continue } - text := filt.TextOnly(div) + text := htf.TextOnly(div) text = strings.Replace(text, "\n", " ", -1) text = strings.Replace(text, "pic.twitter.com", "https://pic.twitter.com", -1)
M
markitzero_test.go
→
markitzero_test.go
@@ -76,4 +76,3 @@ input := `an image <img alt="caption" src="https://example.com/wherever"> and linked [<img src="there">](example.com)`
output := `an image <img alt="caption" src="https://example.com/wherever"> and linked <a class="mention u-url" href="example.com"><img src="there"></a>` doonezerotest(t, input, output) } -
M
web.go
→
web.go
@@ -34,7 +34,6 @@
"github.com/gorilla/mux" "humungus.tedunangst.com/r/webs/cache" "humungus.tedunangst.com/r/webs/css" - "humungus.tedunangst.com/r/webs/htfilter" "humungus.tedunangst.com/r/webs/httpsig" "humungus.tedunangst.com/r/webs/image" "humungus.tedunangst.com/r/webs/junk"@@ -572,11 +571,10 @@ }
u := login.GetUserInfo(r) honks := gethonksbyuser(name, u != nil && u.Username == name, 0) templinfo := getInfo(r) - filt := htfilter.New() templinfo["Name"] = user.Name whatabout := user.About whatabout = markitzero(user.About) - templinfo["WhatAbout"], _ = filt.String(whatabout) + templinfo["WhatAbout"] = template.HTML(whatabout) templinfo["ServerMessage"] = "" templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) honkpage(w, u, honks, templinfo)