Skip to content

fix: a line comment in a text tag's open tag does not end the tag - #272

Merged
DylanPiercey merged 1 commit into
mainfrom
dpiercey-w2-htmljs-rust-4t8x5b-script-comment-crash
Nov 14, 2026
Merged

DylanPiercey merged 1 commit into
mainfrom
dpiercey-w2-htmljs-rust-4t8x5b-script-comment-crash

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

<script// a</script> threw Cannot destructure property 'tagName' of 'parser.activeTag' as it is undefined. A // comment inside a text tag's open tag checked for the tag's closing tag as if it were in the tag's body, closed the tag from there, and then crashed leaving the open tag. Now only a comment in the body (the parsed text content) checks for the closing tag, so one in the open tag runs to the end of its line like any other.

Found by fuzzing one-character deletions of the fixtures (here, the > of <script>); the new script-open-tag-comment fixture covers it.

🤖 Generated with Claude Code

`<script// a</script>` closed the tag from inside its open tag, then threw
leaving it. Only a comment in the tag's body is checked for its closing tag.

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

changeset-bot Bot commented Nov 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5063691

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
htmljs-parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@DylanPiercey
DylanPiercey merged commit 12bad89 into main Nov 14, 2026
8 of 9 checks passed
@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.90%. Comparing base (c90163c) to head (5063691).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #272   +/-   ##
=======================================
  Coverage   99.90%   99.90%           
=======================================
  Files          35       35           
  Lines        5015     5015           
  Branches      990      990           
=======================================
  Hits         5010     5010           
  Misses          5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot mentioned this pull request Nov 14, 2026
@github-project-automation github-project-automation Bot moved this to Done in Roadmap Nov 30, 2026
@DylanPiercey DylanPiercey self-assigned this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant