Skip to content

Commit

Permalink
fix: parse dtd end tag should not be strict
Browse files Browse the repository at this point in the history
  • Loading branch information
muktihari committed Jun 16, 2024
1 parent 92d074c commit 54f76cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ func (t *Tokenizer) RawToken() (b []byte, err error) {
if i >= t.last {
prevLast := t.last
off, i = t.memmoveRemainingBytes(off)
dtdOff = dtdOff - (prevLast - t.last)
if dtdOff != 0 {
dtdOff = dtdOff - (prevLast - t.last)
}
if err = t.manageBuffer(); err != nil {
t.err = err
break
Expand All @@ -193,7 +195,7 @@ func (t *Tokenizer) RawToken() (b []byte, err error) {
case ']':
dtdOff = i
case '>':
if dtdOff == i-1 && t.buf[dtdOff] == ']' {
if t.buf[dtdOff] == ']' {
buf := trim(t.buf[off : i+1 : cap(t.buf)])
t.cur = i + 1
return buf, err
Expand Down

0 comments on commit 54f76cc

Please sign in to comment.