mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
Some minify configuration adjustments
This commit is contained in:
parent
574c2959b8
commit
7204b354a9
18 changed files with 173 additions and 143 deletions
|
@ -14,6 +14,7 @@
|
|||
package parser
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"regexp"
|
||||
"unicode"
|
||||
|
@ -35,6 +36,12 @@ func (c LowerCaseCamelJSONMarshaller) MarshalJSON() ([]byte, error) {
|
|||
converted := keyMatchRegex.ReplaceAllFunc(
|
||||
marshalled,
|
||||
func(match []byte) []byte {
|
||||
|
||||
// Attributes on the form XML, JSON etc.
|
||||
if bytes.Equal(match, bytes.ToUpper(match)) {
|
||||
return bytes.ToLower(match)
|
||||
}
|
||||
|
||||
// Empty keys are valid JSON, only lowercase if we do not have an
|
||||
// empty key.
|
||||
if len(match) > 2 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue