diff options
Diffstat (limited to 'vendor/github.com/tdewolff/minify/v2/html')
-rw-r--r-- | vendor/github.com/tdewolff/minify/v2/html/html.go | 7 | ||||
-rw-r--r-- | vendor/github.com/tdewolff/minify/v2/html/table.go | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/vendor/github.com/tdewolff/minify/v2/html/html.go b/vendor/github.com/tdewolff/minify/v2/html/html.go index 3431ad3be..616a9ba5a 100644 --- a/vendor/github.com/tdewolff/minify/v2/html/html.go +++ b/vendor/github.com/tdewolff/minify/v2/html/html.go @@ -392,14 +392,15 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st } if attr.Traits&caselessAttr != 0 { val = parse.ToLower(val) - if attr.Hash == Enctype || attr.Hash == Codetype || attr.Hash == Accept || attr.Hash == Type && (t.Hash == A || t.Hash == Link || t.Hash == Embed || t.Hash == Object || t.Hash == Source || t.Hash == Script || t.Hash == Style) { - val = minify.Mediatype(val) - } } if rawTagHash != 0 && attr.Hash == Type { rawTagMediatype = parse.Copy(val) } + if attr.Hash == Enctype || attr.Hash == Codetype || attr.Hash == Accept || attr.Hash == Type && (t.Hash == A || t.Hash == Link || t.Hash == Embed || t.Hash == Object || t.Hash == Source || t.Hash == Script || t.Hash == Style) { + val = minify.Mediatype(val) + } + // default attribute values can be omitted if !o.KeepDefaultAttrVals && (attr.Hash == Type && (t.Hash == Script && jsMimetypes[string(val)] || t.Hash == Style && bytes.Equal(val, cssMimeBytes) || diff --git a/vendor/github.com/tdewolff/minify/v2/html/table.go b/vendor/github.com/tdewolff/minify/v2/html/table.go index 1ace143a5..7dd5ae6b7 100644 --- a/vendor/github.com/tdewolff/minify/v2/html/table.go +++ b/vendor/github.com/tdewolff/minify/v2/html/table.go @@ -137,7 +137,7 @@ var tagMap = map[Hash]traits{ } var attrMap = map[Hash]traits{ - Accept: caselessAttr, + Accept: trimAttr, Accept_Charset: caselessAttr, Action: urlAttr, Align: caselessAttr, @@ -156,7 +156,7 @@ var attrMap = map[Hash]traits{ Classid: urlAttr, Clear: caselessAttr, Codebase: urlAttr, - Codetype: caselessAttr, + Codetype: trimAttr, Color: caselessAttr, Cols: trimAttr, Colspan: trimAttr, @@ -172,7 +172,7 @@ var attrMap = map[Hash]traits{ Dir: caselessAttr, Disabled: booleanAttr, Enabled: booleanAttr, - Enctype: caselessAttr, + Enctype: trimAttr, Face: caselessAttr, Formaction: urlAttr, Formnovalidate: booleanAttr, @@ -228,7 +228,7 @@ var attrMap = map[Hash]traits{ Text: caselessAttr, Translate: caselessAttr, Truespeed: booleanAttr, - Type: caselessAttr, + Type: trimAttr, Typemustmatch: booleanAttr, Undeterminate: booleanAttr, Usemap: urlAttr, |