summaryrefslogtreecommitdiff
path: root/vendor/github.com/tdewolff/minify/v2/html/buffer.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-11-06 14:41:31 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-06 14:41:31 +0000
commit74b600655ded2b62b61c7631f96fc14edd9342fe (patch)
tree3e55d8be9c0b38ff59ab34aab719a64327f62ab0 /vendor/github.com/tdewolff/minify/v2/html/buffer.go
parent[chore]: Bump modernc.org/sqlite from 1.26.0 to 1.27.0 (#2339) (diff)
downloadgotosocial-74b600655ded2b62b61c7631f96fc14edd9342fe.tar.xz
[chore]: Bump github.com/tdewolff/minify/v2 from 2.20.0 to 2.20.6 (#2337)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/tdewolff/minify/v2/html/buffer.go')
-rw-r--r--vendor/github.com/tdewolff/minify/v2/html/buffer.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/vendor/github.com/tdewolff/minify/v2/html/buffer.go b/vendor/github.com/tdewolff/minify/v2/html/buffer.go
index f58367b44..f2a6f8c52 100644
--- a/vendor/github.com/tdewolff/minify/v2/html/buffer.go
+++ b/vendor/github.com/tdewolff/minify/v2/html/buffer.go
@@ -8,12 +8,13 @@ import (
// Token is a single token unit with an attribute value (if given) and hash of the data.
type Token struct {
html.TokenType
- Hash Hash
- Data []byte
- Text []byte
- AttrVal []byte
- Traits traits
- Offset int
+ Hash Hash
+ Data []byte
+ Text []byte
+ AttrVal []byte
+ Traits traits
+ Offset int
+ HasTemplate bool
}
// TokenBuffer is a buffer that allows for token look-ahead.
@@ -40,10 +41,11 @@ func (z *TokenBuffer) read(t *Token) {
t.Offset = z.r.Offset()
t.TokenType, t.Data = z.l.Next()
t.Text = z.l.Text()
+ t.HasTemplate = z.l.HasTemplate()
if t.TokenType == html.AttributeToken {
t.Offset += 1 + len(t.Text) + 1
t.AttrVal = z.l.AttrVal()
- if len(t.AttrVal) > 1 && (t.AttrVal[0] == '"' || t.AttrVal[0] == '\'') {
+ if 1 < len(t.AttrVal) && (t.AttrVal[0] == '"' || t.AttrVal[0] == '\'') {
t.Offset++
t.AttrVal = t.AttrVal[1 : len(t.AttrVal)-1] // quotes will be readded in attribute loop if necessary
}