Skip to content

Commit 4e4d04b

Browse files
committed
Bugfix: attr index buffer still used old indices
1 parent 1349c89 commit 4e4d04b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

html/html.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ func Minify(m minify.Minifier, _ string, w io.Writer, r io.Reader) error {
379379
func getAttributes(tb *html.TokenBuffer, attrIndexBuffer *[]int, attrTokenBuffer *[]*html.Token, hashes ...html.Hash) []*html.Token {
380380
*attrIndexBuffer = (*attrIndexBuffer)[:len(hashes)]
381381
*attrTokenBuffer = (*attrTokenBuffer)[:len(hashes)]
382+
for j, _ := range *attrIndexBuffer {
383+
(*attrIndexBuffer)[j] = 0
384+
}
382385
i := 0
383386
for {
384387
t := tb.Peek(i)

0 commit comments

Comments
 (0)