mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03: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:
parent
6b9934a266
commit
ebb56e8bdb
8 changed files with 87 additions and 106 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue