From dc96562b4084e058846aea9102ef0257461717d6 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 11 Aug 2023 14:40:11 +0200 Subject: [bugfix] Use custom bluemonday policy to disallow inline img tags (#2100) --- internal/text/plain.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'internal/text/plain.go') diff --git a/internal/text/plain.go b/internal/text/plain.go index b1c2a2c33..330ebfb15 100644 --- a/internal/text/plain.go +++ b/internal/text/plain.go @@ -65,13 +65,10 @@ func (f *formatter) fromPlain( result.HTML = htmlContentBytes.String() // Clean anything dangerous out of resulting HTML. - result.HTML = SanitizeHTML(result.HTML) + result.HTML = SanitizeToHTML(result.HTML) // Shrink ray! - var err error - if result.HTML, err = m.String("text/html", result.HTML); err != nil { - log.Errorf(ctx, "error minifying HTML: %s", err) - } + result.HTML = MinifyHTML(result.HTML) return result } -- cgit v1.2.3