• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

inikulin / parse5 / 39873271538
96%

Build:
DEFAULT BRANCH: master
Ran 22 Oct 2026 11:40PM UTC
Jobs 1
Files 41
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Oct 2026 11:39PM UTC coverage: 95.579% (+0.05%) from 95.528%
39873271538

push

github

web-flow
feat: allow flushing buffered character tokens (#1854)

* feat: allow flushing buffered character tokens

Add flushCharacters() to ParserStream and Tokenizer instances. Character-token batching can leave trailing text out of the tree until more input arrives. Consumers implementing document.write(), such as jsdom, need to make that text synchronously observable without ending the input stream.

Flushing delivers buffered character tokens but leaves incomplete tags and character references pending. It does not resume suspended scripts, drain queued stream writes, or bypass the tree builder's pending table-character processing. Calls from parser callbacks are rejected to prevent reentrant token delivery.

Derive source boundaries from tokenizer state at flush time so ordinary parsing needs no per-character boundary tracking. Keep attribute locations independent of character locations, since flushing can occur while an attribute is incomplete. Correct source positions for lookahead emissions and surrogate pairs so offsets and columns agree.

Flushing splits character-token runs, so text-node source ranges can differ from parsing without flushing: subsequently ignored input, such as CDATA delimiters or the leading newline in a <pre> element, does not extend an already flushed run.

Co-Authored-By: codex <codex@openai.com>

* fix: preserve text offsets after flushing split CRLF

Exclude the ignored LF from the next character token's source range when its preceding CR was flushed. Text following the discarded leading newline in pre, textarea, and listing elements then starts at the actual character offset.

Co-Authored-By: codex <codex@openai.com>

* perf: avoid splitting flushed text into lines

Compute flushed character-token locations with indexOf() scans instead of allocating an array of line substrings. Keep the scans bounded to emitted text so large unfinished tags or attributes do not increase flush cost.

Co-Authored-By: codex <codex@openai.com>

--... (continued)

540 of 543 branches covered (99.45%)

78 of 78 new or added lines in 3 files covered. (100.0%)

3870 of 4049 relevant lines covered (95.58%)

44971.68 hits per line

Jobs
ID Job ID Ran Files Coverage
1 39873271538.1 22 Oct 2026 11:40PM UTC 41
95.58
GitHub Action Run
Source Files on build 39873271538
  • Tree
  • List 41
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #39873271538
  • e68973cd on github
  • Prev Build on master (#39391452996)
  • Next Build on master (#40297547813)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc