From 2b26a345cd29922a25e98011f72de36fdc5bb4a3 Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Sun, 29 Jun 2025 21:55:34 +0200 Subject: [PATCH] perf(processor): minify content even further There is no need to keep comments (conditionals or not, as IE isn't a thing anymore), nor default attribute values. --- internal/reader/processor/utils.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/reader/processor/utils.go b/internal/reader/processor/utils.go index b3184443..c133fcc9 100644 --- a/internal/reader/processor/utils.go +++ b/internal/reader/processor/utils.go @@ -61,8 +61,11 @@ func minifyContent(content string) string { // Options required to avoid breaking the HTML content. m.Add("text/html", &html.Minifier{ - KeepEndTags: true, - KeepQuotes: true, + KeepEndTags: true, + KeepQuotes: true, + KeepComments: false, + KeepSpecialComments: false, + KeepDefaultAttrVals: false, }) if minifiedHTML, err := m.String("text/html", content); err == nil {