diff options
author | 2023-09-11 09:50:58 +0000 | |
---|---|---|
committer | 2023-09-11 09:50:58 +0000 | |
commit | ecbce17655f6df318b9000c4df953f36d4cf2de8 (patch) | |
tree | f389fd2d0b20c90857a5d76e63a51c93826d7a5d /vendor/github.com | |
parent | [chore]: Bump golang.org/x/crypto from 0.12.0 to 0.13.0 (#2190) (diff) | |
download | gotosocial-ecbce17655f6df318b9000c4df953f36d4cf2de8.tar.xz |
[chore]: Bump github.com/tdewolff/minify/v2 from 2.12.8 to 2.12.9 (#2194)
Diffstat (limited to 'vendor/github.com')
-rw-r--r-- | vendor/github.com/tdewolff/minify/v2/html/html.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/tdewolff/minify/v2/html/html.go b/vendor/github.com/tdewolff/minify/v2/html/html.go index fe5d9ae99..6bec42eba 100644 --- a/vendor/github.com/tdewolff/minify/v2/html/html.go +++ b/vendor/github.com/tdewolff/minify/v2/html/html.go @@ -95,11 +95,15 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st if bytes.HasPrefix(t.Data, []byte("<!--[if ")) && bytes.HasSuffix(t.Data, []byte("<![endif]-->")) { // downlevel-hidden begin := bytes.IndexByte(t.Data, '>') + 1 end := len(t.Data) - len("<![endif]-->") - w.Write(t.Data[:begin]) - if err := o.Minify(m, w, buffer.NewReader(t.Data[begin:end]), nil); err != nil { - return minify.UpdateErrorPosition(err, z, t.Offset) + if begin < end { + w.Write(t.Data[:begin]) + if err := o.Minify(m, w, buffer.NewReader(t.Data[begin:end]), nil); err != nil { + return minify.UpdateErrorPosition(err, z, t.Offset) + } + w.Write(t.Data[end:]) + } else { + w.Write(t.Data) // malformed } - w.Write(t.Data[end:]) } else { w.Write(t.Data) // downlevel-revealed or short downlevel-hidden } |