mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Improve minifier MIME type resolution
This commit also removes the deprecated `Suffix` from MediaType. Now use `Suffixes` and put the MIME type suffix in the type, e.g. `application/svg+xml`. Fixes #5093
This commit is contained in:
@@ -32,4 +32,10 @@ func TestNew(t *testing.T) {
|
||||
|
||||
assert.NoError(m.Minify(media.CSSType, &b, strings.NewReader("body { color: blue; }")))
|
||||
assert.Equal("body{color:blue}", b.String())
|
||||
|
||||
b.Reset()
|
||||
|
||||
// RSS should be handled as XML
|
||||
assert.NoError(m.Minify(media.RSSType, &b, strings.NewReader("<hello> Hugo! </hello> ")))
|
||||
assert.Equal("<hello>Hugo!</hello>", b.String())
|
||||
}
|
||||
|
Reference in New Issue
Block a user