gates:pre green again: the tree generator's quote-escaping regex no longer desyncs the template-literal check
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:
parent
2f4bdf561d
commit
d2a643d0aa
1 changed files with 1 additions and 1 deletions
|
|
@ -481,7 +481,7 @@ function readTokenUrlExpr() {
|
|||
// ── HTML escaping ────────────────────────────────────────────────────────────
|
||||
const esc = (s) => String(s)
|
||||
.replace(/&/g, '&').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 = `
|
||||
|
|
|
|||
Loading…
Reference in a new issue