Skip to content

fix(html): escape attribute quotes in library.html + add HTML parse gate#34

Merged
New1Direction merged 1 commit into
mainfrom
fix/html-parse-gate
Jun 16, 2026
Merged

fix(html): escape attribute quotes in library.html + add HTML parse gate#34
New1Direction merged 1 commit into
mainfrom
fix/html-parse-gate

Conversation

@New1Direction

Copy link
Copy Markdown
Owner

Summary

Fixes a live bug on a shipped surface and closes the blind spot that let it (and the earlier options.html smart-quote crash) ship.

  • library.html:616 — the ask-bar placeholder had unescaped inner double-quotes (placeholder="Ask your library… e.g. "What's my best SSR option?""). The first inner " terminated the attribute early, so the browser dropped the rest of the tag — including the aria-label. Fixed by escaping with ".
  • Root cause — HTML is invisible to node --check, vitest, and eslint, and CI's format:check is continue-on-error (advisory), so prettier flagged it but never blocked the build.

The gate

tools/check-html.mjs is a parse-only validity gate over all tracked *.html. It uses prettier's parser via the Node API, which throws on a real structural error but merely reformats on style — so it fails only on genuine parse errors, never on formatting drift. Wired into CI as a blocking step (HTML parse check); format:check stays advisory.

Changes

File Change
library.html Escape inner " in the ask-bar placeholder
tools/check-html.mjs New parse-validity gate over all tracked HTML
package.json check:html script
.github/workflows/ci.yml Blocking HTML parse check step
eslint.config.js Allow console in tools/** (CLI output by design)

Test plan

  • npm run check:html → passes, 20 files parse cleanly
  • Confirmed it fails on the bug before the fix (SyntaxError: Opening tag "input" not terminated. (616:7)) and passes after
  • npx vitest run → 849 passed (87 files)
  • npx eslint . → 0 errors, 25 warnings (back to baseline; tools/** override keeps the new CLI file warning-free)

library.html:616 had unescaped inner double-quotes in the ask-bar
placeholder ("...e.g. "What's my best SSR option?""), which terminated
the attribute early — the browser dropped the rest of the tag including
the aria-label. Same class as the options.html smart-quote crash.

Root cause: HTML is invisible to node --check, vitest, and eslint, and
CI's format:check is advisory (continue-on-error), so prettier flagged
it but never blocked. Add a parse-only gate (tools/check-html.mjs) that
fails ONLY on real structural errors via prettier's parser, wired into
CI as a blocking step. Formatting drift stays advisory.

- Fix the unescaped quotes (")
- tools/check-html.mjs: parse-validity gate over all tracked *.html
- package.json: check:html script
- ci.yml: blocking "HTML parse check" step
- eslint.config.js: allow console in tools/** (CLI output by design)
@New1Direction New1Direction merged commit 2c3c40a into main Jun 16, 2026
1 check passed
@New1Direction New1Direction deleted the fix/html-parse-gate branch June 16, 2026 23:35
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