Skip to content

fix(core/lint): findRootTag ignores <video>-like tokens inside HTML comments / <style> / <script>#1446

Closed
ukimsanov wants to merge 1 commit into
mainfrom
fix/core-lint-mask-ranges
Closed

fix(core/lint): findRootTag ignores <video>-like tokens inside HTML comments / <style> / <script>#1446
ukimsanov wants to merge 1 commit into
mainfrom
fix/core-lint-mask-ranges

Conversation

@ukimsanov

@ukimsanov ukimsanov commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

A literal <video> token written inside a CSS comment block (e.g. /* card uses <video> as surface */) was being picked as the composition root, producing two cascading false errors: root_missing_composition_id + root_missing_dimensions.

findRootTag now masks <!-- --> / <style>…</style> / <script>…</script> ranges with same-length whitespace (so tag offsets stay aligned for downstream consumers) before running the tag scan.

Verification

  • Existing stripJsComments / extractScriptTextsAndSrcs exports preserved (downstream rule consumers in rules/{adapters,composition,core,gsap}.ts read rootTag.raw + rootTag.index against the real source offsets — safe under the new masking)
  • bun run --filter @hyperframes/core test passes

Sibling PRs in this stack

All three independent; merge order doesn't matter.

Test plan

  • bun run --filter @hyperframes/core typecheck passes
  • bun run --filter @hyperframes/core test passes

…omments / <style> / <script>

A literal `<video>` written inside a CSS comment block (e.g.
`/* card uses <video> as surface */`) was being picked as the
composition root, producing two cascading false errors:
`root_missing_composition_id` + `root_missing_dimensions`.

`findRootTag` now masks comment + style + script ranges (with same-length
whitespace so tag offsets stay aligned) before running the tag scan.
Existing `stripJsComments` / `extractScriptTextsAndSrcs` exports preserved
(downstream rule consumers in rules/{adapters,composition,core,gsap}.ts
still read `rootTag.raw` + `rootTag.index` against the real source
offsets — safe under the new masking).
@ukimsanov ukimsanov force-pushed the fix/core-lint-mask-ranges branch from 86e7fe1 to c4e13ef Compare June 14, 2026 23:48
@ukimsanov

Copy link
Copy Markdown
Collaborator Author

Closing — verified no composition in current main has the trigger pattern (<video> token literally written inside a CSS comment / <style> / <script> block). Synthetic repro works but no real user hits it. Re-open if someone reports it.

@ukimsanov ukimsanov closed this Jun 15, 2026
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.

1 participant