summaryrefslogtreecommitdiff
path: root/vendor/github.com/tdewolff/minify/v2/html/html.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2025-04-07 11:05:22 +0100
committerLibravatar GitHub <noreply@github.com>2025-04-07 11:05:22 +0100
commite0ea77b7306b959525a0d5c015f4c69832ce9f01 (patch)
treef2508dbe6fb55b667b7c2a602cd8232fa4025cb1 /vendor/github.com/tdewolff/minify/v2/html/html.go
parent[chore]: Bump golang.org/x/crypto from 0.36.0 to 0.37.0 (#3975) (diff)
downloadgotosocial-e0ea77b7306b959525a0d5c015f4c69832ce9f01.tar.xz
[chore]: Bump github.com/tdewolff/minify/v2 from 2.22.4 to 2.23.0 (#3974)
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.22.4 to 2.23.0. - [Release notes](https://github.com/tdewolff/minify/releases) - [Commits](https://github.com/tdewolff/minify/compare/v2.22.4...v2.23.0) --- updated-dependencies: - dependency-name: github.com/tdewolff/minify/v2 dependency-version: 2.23.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/tdewolff/minify/v2/html/html.go')
-rw-r--r--vendor/github.com/tdewolff/minify/v2/html/html.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/vendor/github.com/tdewolff/minify/v2/html/html.go b/vendor/github.com/tdewolff/minify/v2/html/html.go
index ce5e96dc3..45643c5d8 100644
--- a/vendor/github.com/tdewolff/minify/v2/html/html.go
+++ b/vendor/github.com/tdewolff/minify/v2/html/html.go
@@ -145,11 +145,11 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st
w.Write(t.Data)
}
omitSpace = false
+ case html.TemplateToken:
+ w.Write(t.Data)
+ omitSpace = false
case html.TextToken:
- if t.HasTemplate {
- w.Write(t.Data)
- omitSpace = parse.IsWhitespace(t.Data[len(t.Data)-1])
- } else if rawTagHash != 0 {
+ if rawTagHash != 0 && !t.HasTemplate {
if rawTagHash == Style || rawTagHash == Script || rawTagHash == Iframe {
var mimetype []byte
var params map[string]string
@@ -196,7 +196,7 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st
t.Data = t.Data[:len(t.Data)-1]
omitSpace = false
break
- } else if next.TokenType == html.TextToken && !parse.IsAllWhitespace(next.Data) {
+ } else if next.TokenType == html.TextToken && !parse.IsAllWhitespace(next.Data) || next.TokenType == html.TemplateToken {
// stop looking when text encountered
break
} else if next.TokenType == html.StartTagToken || next.TokenType == html.EndTagToken || next.TokenType == html.SvgToken || next.TokenType == html.MathToken {
@@ -215,7 +215,6 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st
i++
}
}
-
w.Write(t.Data)
}
case html.StartTagToken, html.EndTagToken: