diff --git a/README.md b/README.md index f42053b..5684565 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,20 @@ red PR job against. their ARIA pair, and every `[data-*]` selector an inline script queries exists in the markup (so a dropped attribute cannot make a carousel silently no-op). Each rule has a fixture self-test. Zero dependencies. +- `node --test scripts/page-structure.test.mjs` — static tree gate over every committed + HTML page (redirect shortcuts and `404.html` included). Browsers never reject malformed + HTML, they repair it silently, so the gate parses each page the way the HTML tokenizer + does (comments, raw-text ``); + assert.deepEqual(toks.map((t) => `${t.type}:${t.name}`), ["start:a", "start:script", "end:script", "end:a"]); + assert.deepEqual(attributes(toks[0].raw), [{ name: "title", value: "x>y" }, { name: "data-q", value: ">" }]); + assert.deepEqual(attributes(``), [ + { name: "disabled", value: null }, { name: "type", value: "text" }, { name: "data-n", value: "" }, + ]); +}); + +test("fixture: unclosed comment, unterminated tag and unclosed