Skip to content

fix(decode): re-enable streaming#2117

Merged
fb55 merged 4 commits intomainfrom
fixes
Jan 21, 2026
Merged

fix(decode): re-enable streaming#2117
fb55 merged 4 commits intomainfrom
fixes

Conversation

@fb55
Copy link
Owner

@fb55 fb55 commented Jan 21, 2026

7.0.0 brought a regression to streaming support (see fb55/htmlparser2#2215). This PR addresses these issues.

Copilot AI review requested due to automatic review settings January 21, 2026 12:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a streaming regression introduced in version 7.0.0 of htmlparser2. The regression prevented entities from being decoded when input was provided incrementally across multiple chunks, which broke streaming use cases.

Changes:

  • Refactored entity decoding logic to support incremental processing of multi-character entity runs
  • Added comprehensive streaming tests to prevent future regressions
  • Updated import paths in code generation script to reflect internal module organization

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
src/decode.ts Added runConsumed state variable and refactored compact run decoding logic to support character-by-character streaming
src/decode-stream.spec.ts New comprehensive test suite covering various streaming scenarios including char-by-char and chunked entity decoding
scripts/write-decode-map.ts Updated import path to reference decode-shared.js from correct internal directory location
.gitignore Added .tshy-build/ directory to ignore build artifacts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fb55 fb55 merged commit d97b64f into main Jan 21, 2026
13 checks passed
@fb55 fb55 deleted the fixes branch January 21, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants