You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ac2f60d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(sax-parser): flush completed text at chunk boundaries
A long run of text made the stream keep its whole pending text token and its input. `Tokenizer#flushCurrentCharacterToken` (internal) emits the pending text when the preprocessor is about to drop a parsed chunk, in every state without an unfinished token, and SAX calls it after each write. The text ends where `getCharacterTokenEndOffset()` puts it, before a pending CDATA end delimiter, character reference or `<` in script data, and `Preprocessor#dropParsedChunk(keep)` keeps only those code units, so the retained input is bounded by a chunk plus the longest such construct. An empty character token follows the flush, so the source range of CDATA delimiters or a tag discarded at EOF stays intact; SAX skips empty tokens, and as a character token rather than one of the flushed type it adds no replacement character in foreign content. The feedback simulator clears its skip-first-newline flag on any flushed text.
The cases assert the flushed text before the input ends, exact source ranges across 16 KiB chunks, also when every chunk ends in a delimiter or reference, a bounded buffer and offset, raw forwarding across a split unknown reference, a surrogate pair at a chunk end, the `<pre>` newline, an unfinished tag after a flush, and a single replacement character after flushed null characters.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
0 commit comments