diff --git a/html/html.go b/html/html.go index eeb05a60e9..3b4397c264 100644 --- a/html/html.go +++ b/html/html.go @@ -224,10 +224,6 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st rawTagHash = 0 } } - } else if t.Hash == I { - if next := tb.Peek(1); next.Hash == I && next.TokenType == html.EndTagToken { - omitSpace = false - } } } else if t.Hash == Template { omitSpace = true // EndTagToken @@ -503,6 +499,13 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st tb.Shift() } } + + // keep space after for FontAwesome etc. + if t.TokenType == html.StartTagToken && t.Hash == I { + if next := tb.Peek(0); next.Hash == I && next.TokenType == html.EndTagToken { + omitSpace = false + } + } } } } diff --git a/html/html_test.go b/html/html_test.go index 392249d2bc..d16e7cecc1 100644 --- a/html/html_test.go +++ b/html/html_test.go @@ -148,8 +148,8 @@ func TestHTML(t *testing.T) { {`