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

Kikobeats / html-scripts / 40593799807
100%

Build:
DEFAULT BRANCH: master
Ran 27 Oct 2026 10:18PM UTC
Jobs 1
Files 1
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

27 Oct 2026 10:18PM UTC coverage: 100.0%. Remained the same
40593799807

push

github

web-flow
perf(parse): stream script tags with htmlparser2 instead of building a himalaya AST (#18)

* perf(parse): stream script tags with htmlparser2 instead of building a himalaya AST

himalaya tokenizes, builds a full node tree, and walks it just to find
<script> tags. htmlparser2's streaming Parser with onopentagname/onattribute
collects attributes only for script tags and builds no tree.

A/B, node benchmark/index.js, 6 alternating runs per side, median (range):

| case                 | base               | change             | delta  |
| -------------------- | ------------------ | ------------------ | ------ |
| getScripts 1MB page  | 75.1ms (72.4-77.0) | 36.0ms (35.6-36.9) | -52.1% |
| getScripts 20KB page | 72.2ms (69.6-74.2) | 45.8ms (45.3-46.2) | -36.6% |

Output changes (spec-correct, each covered by a test):
- attribute names are lowercased (<SCRIPT SRC> gave {SRC})
- entities in attribute values are decoded (&amp; stayed literal)
- unquoted values containing "/" are kept (src=/m.js gave src: true)
- scripts after a stray </script> are found (himalaya dropped them)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: boolean attributes come out as true

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(parse): keep a self-closing script's content as text

htmlparser2 leaves raw-text mode on `<script/>`, so markup inside the script
body was reported as more scripts. Tags seen while a script is open are now
ignored, as browsers do. Input is read with String() so a Buffer parses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(parse): never let template depth go negative

A template opened inside a self-closing script's text is skipped, but a
script nested in it closes the raw text first, so the template's real close
tag decremented a depth that was never incremented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(parse): match browser script and raw-text rules

htmlparser2 ends an HTML scrip... (continued)

82 of 82 branches covered (100.0%)

Branch coverage included in aggregate %.

168 of 168 new or added lines in 1 file covered. (100.0%)

181 of 181 relevant lines covered (100.0%)

60.75 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40593799807.1 27 Oct 2026 10:18PM UTC 1
100.0
GitHub Action Run
Source Files on build 40593799807
  • Tree
  • List 1
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40593799807
  • 13370d51 on github
  • Prev Build on master (#40567289162)
  • Next Build on master (#40649828055)
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