From 6b2bf3b387a5fb6efb7778a248205c27ce976413 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 26 Jul 2020 16:25:28 -0400 Subject: [PATCH] replace emoji after html filtering --- fun.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fun.go b/fun.go index dd438ca..d887689 100644 --- a/fun.go +++ b/fun.go @@ -188,6 +188,9 @@ func filterchonk(ch *Chonk) { local = true } + ch.HTML, _ = htf.String(noise) + noise = string(ch.HTML) + zap := make(map[string]bool) emuxifier := func(e string) string { for _, d := range ch.Donks { @@ -217,12 +220,10 @@ func filterchonk(ch *Chonk) { } ch.Donks = ch.Donks[:j] - ch.HTML, _ = htf.String(noise) - n := string(ch.HTML) - - if strings.HasPrefix(n, "

") { - ch.HTML = template.HTML(n[3:]) + if strings.HasPrefix(noise, "

") { + noise = noise[3:] } + ch.HTML = template.HTML(noise) if short := shortname(ch.UserID, ch.Who); short != "" { ch.Handle = short } else {