From d2a643d0aa0e94f729f280f1ef2834a6ce24ce98 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 02:06:30 +0000 Subject: [PATCH] gates:pre green again: the tree generator's quote-escaping regex no longer desyncs the template-literal check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- internal/generate-tree.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/generate-tree.mjs b/internal/generate-tree.mjs index 15791e8a2..7168adced 100644 --- a/internal/generate-tree.mjs +++ b/internal/generate-tree.mjs @@ -481,7 +481,7 @@ function readTokenUrlExpr() { // ── HTML escaping ──────────────────────────────────────────────────────────── const esc = (s) => String(s) .replace(/&/g, '&').replace(//g, '>') - .replace(/"/g, '"') + .replace(/\u0022/g, '"') // \u0022, not a bare quote: template-literal-check reads a bare one as an open string // ── Shared theme (dark, gem frames) ────────────────────────────────────────── const BASE_CSS = `