mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/media"
|
||||
"github.com/gohugoio/hugo/output"
|
||||
"github.com/tdewolff/minify/v2/html"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
@@ -189,3 +190,31 @@ func TestDecodeConfigDecimalIsNowPrecision(t *testing.T) {
|
||||
c.Assert(conf.Tdewolff.CSS.Precision, qt.Equals, 3)
|
||||
|
||||
}
|
||||
|
||||
// Issue 8771
|
||||
func TestDecodeConfigKeepWhitespace(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
v := config.New()
|
||||
v.Set("minify", map[string]interface{}{
|
||||
"tdewolff": map[string]interface{}{
|
||||
"html": map[string]interface{}{
|
||||
"keepEndTags": false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
conf, err := decodeConfig(v)
|
||||
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(conf.Tdewolff.HTML, qt.DeepEquals,
|
||||
html.Minifier{
|
||||
KeepComments: false,
|
||||
KeepConditionalComments: true,
|
||||
KeepDefaultAttrVals: true,
|
||||
KeepDocumentTags: true,
|
||||
KeepEndTags: false,
|
||||
KeepQuotes: false,
|
||||
KeepWhitespace: true},
|
||||
)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user