From 05eab9e4e5a5097ddc8538f7b29841660fe7fcfc Mon Sep 17 00:00:00 2001 From: Levi Neuwirth Date: Thu, 23 Jul 2026 14:47:41 -0400 Subject: [PATCH] docs(web): frame HTML + CSS grammars + HTML injections (approved rev 3) Add tree-sitter HTML and CSS grammars for .html/.htm/.xhtml and .css highlighting, and light up HTML's ` parses as JavaScript and + `` parses as CSS, via HTML's crate-exported injections query + riding the #122 injection engine. CSS is registered here so the `` and `` produces a + `ParseTreeBundle` whose child layers resolve to `css` and `javascript`, and + a grid-paint asserts an injected CSS property and JS keyword paint **inside** + the embedded regions (mirroring `grid_paints_injected_child_keyword`). +6. **Paint (non-vacuous highlighting)**: parse `` and assert **both** + the `` tag (`@tag`) **and** the `href` attribute name (`@attribute`) paint + the two new non-default styles — the attribute assertion is load-bearing, since + a tag-only test could pass with `@attribute` unverified. Also assert a CSS + selector (`@tag`) paints the new `tag` style and an ordinary CSS property + (`color` → `@property`) paints non-default (an ordinary property has a single + unconditional capture, so no precedence subtlety — Q#WEB4). +7. **Full gate suite** per `CLAUDE.md`. + +## 7. Prior art in pmacs + +- **LaTeX lane #144** (`docs/latex-grammar-math-substrate-framing.md`) — the + grammar-add mechanics, the table-guard/smoke/paint test conventions, and the + compile-gate-plus-paint-test discipline. (Its overlay convention is not + needed here.) +- **Multi-language injections #122** + (`docs/multi-language-injections-framing.md`) — the `ParseTreeBundle` + + `Layer` engine HTML's injections ride. +- **markdown → rust fenced code** (`src/syntax.rs:848`, tested by + `src/highlight.rs`'s `grid_paints_injected_child_keyword`) — the working + injection precedent this lane's acceptance 5 mirrors.