all repos — honk @ 3c8909e9f0a2a3e46852effcbc3a3bebb2a10ef0

my fork of honk

safer to use templates sprintf to build html
Ted Unangst tedu@tedunangst.com
Sat, 11 Feb 2023 19:56:27 -0500
commit

3c8909e9f0a2a3e46852effcbc3a3bebb2a10ef0

parent

0116f718f85ad25457257e26b0d3862c6183b0f2

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M hoot.gohoot.go

@@ -26,6 +26,7 @@

"github.com/andybalholm/cascadia" "golang.org/x/net/html" "humungus.tedunangst.com/r/webs/htfilter" + "humungus.tedunangst.com/r/webs/templates" ) var tweetsel = cascadia.MustCompile("div[data-testid=tweetText]")

@@ -57,7 +58,7 @@ alt := htfilter.GetAttr(node, "alt")

if htfilter.HasClass(node, "Emoji") && alt != "" { return alt } - return fmt.Sprintf(" <img src='%s' alt='%s'>", htfilter.GetAttr(node, "src"), alt) + return string(templates.Sprintf(" <img src='%s' alt='%s'>", htfilter.GetAttr(node, "src"), alt)) } var buf strings.Builder