summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/net/html/token.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/net/html/token.go')
-rw-r--r--vendor/golang.org/x/net/html/token.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/golang.org/x/net/html/token.go b/vendor/golang.org/x/net/html/token.go
index be3c7541..ae24a6fd 100644
--- a/vendor/golang.org/x/net/html/token.go
+++ b/vendor/golang.org/x/net/html/token.go
@@ -605,7 +605,10 @@ func (z *Tokenizer) readComment() {
z.data.end = z.data.start
}
}()
- for dashCount := 2; ; {
+
+ var dashCount int
+ beginning := true
+ for {
c := z.readByte()
if z.err != nil {
// Ignore up to two dashes at EOF.
@@ -620,7 +623,7 @@ func (z *Tokenizer) readComment() {
dashCount++
continue
case '>':
- if dashCount >= 2 {
+ if dashCount >= 2 || beginning {
z.data.end = z.raw.end - len("-->")
return
}
@@ -638,6 +641,7 @@ func (z *Tokenizer) readComment() {
}
}
dashCount = 0
+ beginning = false
}
}