From 4fc4b67f918b0bd42b22d32228cc8c1599e8fbfc Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 10 Nov 2019 23:49:09 -0500 Subject: [PATCH] normalize image urls --- fun.go | 3 +++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fun.go b/fun.go index 5c6e059..6d6017f 100644 --- a/fun.go +++ b/fun.go @@ -24,6 +24,7 @@ import ( "io" "log" "net/http" + "net/url" "os" "regexp" "strings" @@ -95,6 +96,7 @@ func reverbolate(userid int64, honks []*Honk) { var htf htfilter.Filter htf.Imager = replaceimgsand(zap, false) htf.SpanClasses = allowedclasses + htf.BaseURL, _ = url.Parse(h.XID) p, _ := htf.String(h.Precis) n, _ := htf.String(h.Noise) h.Precis = string(p) @@ -183,6 +185,7 @@ func inlineimgsfor(honk *Honk) func(node *html.Node) string { func imaginate(honk *Honk) { var htf htfilter.Filter htf.Imager = inlineimgsfor(honk) + htf.BaseURL, _ = url.Parse(honk.XID) htf.String(honk.Noise) } diff --git a/go.mod b/go.mod index f4a3c35..5822c8c 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( 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.24 + humungus.tedunangst.com/r/webs v0.6.25 ) go 1.11 diff --git a/go.sum b/go.sum index 3438010..93154ad 100644 --- a/go.sum +++ b/go.sum @@ -22,5 +22,5 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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.24 h1:/Svffk8mEWXsb7RiKJ94g/FKi941C5pbRX6UKFc4bXs= -humungus.tedunangst.com/r/webs v0.6.24/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= +humungus.tedunangst.com/r/webs v0.6.25 h1:Vq9P9q83al9RX/tKF5eZbZCu8BRseKgDe0AXXM7gltY= +humungus.tedunangst.com/r/webs v0.6.25/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps=