diff options
author | Joe Mooring <[email protected]> | 2022-03-08 22:48:18 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2022-03-09 07:48:18 +0100 |
commit | c97fed08f90b3758c85d3f67f038cd1f794d16fc (patch) | |
tree | aa811701f719402af18b31d46ccdd32d2ba1ed87 | |
parent | 53a6210d82eaa2cff7c802df88ff08dac5e7dced (diff) | |
download | hugo-c97fed08f90b3758c85d3f67f038cd1f794d16fc.tar.gz hugo-c97fed08f90b3758c85d3f67f038cd1f794d16fc.zip |
minifiers: Make keepWhitespace = false default for HTML (note)
Closes #9456
-rw-r--r-- | minifiers/config.go | 2 | ||||
-rw-r--r-- | minifiers/minifiers_test.go | 4 | ||||
-rw-r--r-- | resources/resource_transformers/minifier/minify_test.go | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/minifiers/config.go b/minifiers/config.go index e56617a06..675e5d2b8 100644 --- a/minifiers/config.go +++ b/minifiers/config.go @@ -35,7 +35,7 @@ var defaultTdewolffConfig = tdewolffConfig{ KeepConditionalComments: true, KeepEndTags: true, KeepDefaultAttrVals: true, - KeepWhitespace: true, + KeepWhitespace: false, }, CSS: css.Minifier{ Precision: 0, diff --git a/minifiers/minifiers_test.go b/minifiers/minifiers_test.go index ece8cbd08..9866f67da 100644 --- a/minifiers/minifiers_test.go +++ b/minifiers/minifiers_test.go @@ -191,7 +191,7 @@ func TestDecodeConfigDecimalIsNowPrecision(t *testing.T) { } -// Issue 8771 +// Issue 9456 func TestDecodeConfigKeepWhitespace(t *testing.T) { c := qt.New(t) v := config.New() @@ -214,7 +214,7 @@ func TestDecodeConfigKeepWhitespace(t *testing.T) { KeepDocumentTags: true, KeepEndTags: false, KeepQuotes: false, - KeepWhitespace: true}, + KeepWhitespace: false}, ) } diff --git a/resources/resource_transformers/minifier/minify_test.go b/resources/resource_transformers/minifier/minify_test.go index cc5f7af41..b0ebe3171 100644 --- a/resources/resource_transformers/minifier/minify_test.go +++ b/resources/resource_transformers/minifier/minify_test.go @@ -38,5 +38,5 @@ func TestTransform(t *testing.T) { c.Assert(transformed.RelPermalink(), qt.Equals, "/hugo.min.html") content, err := transformed.(resource.ContentProvider).Content() c.Assert(err, qt.IsNil) - c.Assert(content, qt.Equals, "<h1> Hugo Rocks! </h1>") + c.Assert(content, qt.Equals, "<h1>Hugo Rocks!</h1>") } |