fix(html): escape attribute quotes in library.html + add HTML parse gate#34
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a live bug on a shipped surface and closes the blind spot that let it (and the earlier
options.htmlsmart-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 thearia-label. Fixed by escaping with".node --check,vitest, andeslint, and CI'sformat:checkiscontinue-on-error(advisory), so prettier flagged it but never blocked the build.The gate
tools/check-html.mjsis 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:checkstays advisory.Changes
library.html"in the ask-bar placeholdertools/check-html.mjspackage.jsoncheck:htmlscript.github/workflows/ci.ymlHTML parse checkstepeslint.config.jsconsoleintools/**(CLI output by design)Test plan
npm run check:html→ passes, 20 files parse cleanlySyntaxError: Opening tag "input" not terminated. (616:7)) and passes afternpx vitest run→ 849 passed (87 files)npx eslint .→ 0 errors, 25 warnings (back to baseline;tools/**override keeps the new CLI file warning-free)