diff options
author | James Kiefer <zinefer@gmail.com> | 2018-09-12 11:33:14 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-09-12 19:33:14 +0200 |
commit | 3dafe206e31bb92f27802a04bf9159cbc20af234 (patch) | |
tree | 6b2aabcaa3b98087ece4e2a85e1d7944366abc07 /minifiers/minifiers.go | |
parent | 37d6463479952f7dfba59d899eed38b41e223283 (diff) |
minifiers: Make JSON minification more generic
Add a regex matcher for json types. Specifically support LD+JSON which
allows for google seo minification out of the box. Expanded JS/JSON
minification testing.
Diffstat (limited to 'minifiers/minifiers.go')
-rw-r--r-- | minifiers/minifiers.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/minifiers/minifiers.go b/minifiers/minifiers.go index 073898815..07eec34ce 100644 --- a/minifiers/minifiers.go +++ b/minifiers/minifiers.go @@ -74,6 +74,7 @@ func New(mediaTypes media.Types, outputFormats output.Formats) Client { addMinifierFunc(m, mediaTypes, "css", css.Minify) addMinifierFunc(m, mediaTypes, "js", js.Minify) m.AddFuncRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma)script$"), js.Minify) + m.AddFuncRegexp(regexp.MustCompile("^(application|text)/(x-|ld\\+)?json$"), json.Minify) addMinifierFunc(m, mediaTypes, "json", json.Minify) addMinifierFunc(m, mediaTypes, "svg", svg.Minify) addMinifierFunc(m, mediaTypes, "xml", xml.Minify) |