fix(tokenizer): finish and resume completed input only once
Merged
FB
2mo ago+52+52+01234567890123456789-2-2-0123456789
EOF entity decoding can leave the tokenizer's cursor before the end of the buffer. resume() then re-parsed that suffix and end() could finish twice. Completed input is now finished and resumed only once; two tests pin both paths.
🤖 Generated with Claude Code
Summary by CodeRabbit
- Bug Fixes
- Fixed an issue where resuming after input was fully processed could emit duplicate events or parse input again, including for incomplete comments and character references.
- After the parser is reset, it can process new input and emit its completion event normally. Repeated resumes after completion no longer emit additional events, including when parsing text containing a character reference followed by other text.