gates:pre green again: the tree generator's quote-escaping regex no longer desyncs the template-literal check
Some checks are pending
Deploy to GitHub Pages / build (push) Waiting to run
Deploy to GitHub Pages / deploy (push) Blocked by required conditions

template-literal-check reads source with a simple state machine that does not know regex literals.
The .replace(/"/g, …) in esc() looked to it like an open string, and it stayed "in a string" until a
later quote. Its state happened to re-sync on a `//` inside the forge page template; when 87ebbace
removed that line (the static api.mapbox.com preconnect), the check lost track and flagged a
backtick in an ordinary JSDoc comment (generate-tree.mjs:1084) as a stray backtick in a template.
gates:pre failed for everyone.

The regex is now /\u0022/g: the same character, so escaping is unchanged (verified: 'a"b' → a"b),
and the tree regenerates byte-identical.
This commit is contained in:
Doxa Maps 2026-09-26 02:06:30 +00:00
parent 2f4bdf561d
commit d2a643d0aa

View file

@ -481,7 +481,7 @@ function readTokenUrlExpr() {
// ── HTML escaping ────────────────────────────────────────────────────────────
const esc = (s) => String(s)
.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/\u0022/g, '&quot;') // \u0022, not a bare quote: template-literal-check reads a bare one as an open string
// ── Shared theme (dark, gem frames) ──────────────────────────────────────────
const BASE_CSS = `