From 1d436e3dde1eaf8a965e6a754ff8efc4cd6cd17f Mon Sep 17 00:00:00 2001 From: Taco de Wolff Date: Sun, 23 Jul 2023 11:16:55 +0200 Subject: [PATCH] HTML: fix spacing around ; fixes #592 --- html/html.go | 2 +- html/html_test.go | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/html/html.go b/html/html.go index 616a9ba5ae..33390303d5 100644 --- a/html/html.go +++ b/html/html.go @@ -504,7 +504,7 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st } // keep space after phrasing tags (, , ...) FontAwesome etc. - if t.TokenType == html.StartTagToken && t.Traits&nonPhrasingTag == 0 { + if t.TokenType == html.StartTagToken && t.Traits == normalTag { if next := tb.Peek(0); next.Hash == t.Hash && next.TokenType == html.EndTagToken { omitSpace = false } diff --git a/html/html_test.go b/html/html_test.go index b12c3fa385..0d02898b0e 100644 --- a/html/html_test.go +++ b/html/html_test.go @@ -151,20 +151,21 @@ func TestHTML(t *testing.T) { {`