From 7ebfb37f68395f90cf7cf7303c8484cb2b84f586 Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Fri, 13 Nov 2026 08:57:39 +0100 Subject: [PATCH 1/4] fix(toolbar): escape selectors in markdown audit export Pipes and backticks in element selectors broke the findings table of the Markdown export. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/view/frontend/web/js/toolbar/audits.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/view/frontend/web/js/toolbar/audits.js b/src/view/frontend/web/js/toolbar/audits.js index abdcaec6..2b4290f0 100644 --- a/src/view/frontend/web/js/toolbar/audits.js +++ b/src/view/frontend/web/js/toolbar/audits.js @@ -8,6 +8,16 @@ import { audits, auditGroups } from "./audits/index.js"; // time to finish after synchronous mutations (typically 1–2 frames = 16ms). const AUDIT_SETTLE_DELAY_MS = 200; +/** + * Make a selector safe for an inline code span inside a Markdown table cell. + * + * @param {string} selector + * @returns {string} + */ +function escapeMdCode(selector) { + return selector.replace(/`/g, "'").replace(/\|/g, "\\|").replace(/\s+/g, " "); +} + export const auditMethods = { /** * Toggles an audit on/off and updates the menu item state. @@ -353,7 +363,7 @@ export const auditMethods = { lines.push("| Selector | Severity |"); lines.push("|----------|----------|"); findings.forEach(({ selector, severity }) => { - lines.push(`| \`${selector}\` | ${severity} |`); + lines.push(`| \`${escapeMdCode(selector)}\` | ${severity} |`); }); } else { // Page-level audit: badge only, no element selectors From 249d1a7daf8b2a22e2b2ac50dea8732db52dd83a Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Fri, 13 Nov 2026 08:59:14 +0100 Subject: [PATCH 2/4] fix(toolbar): escape backslashes in markdown export selectors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/view/frontend/web/js/toolbar/audits.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/view/frontend/web/js/toolbar/audits.js b/src/view/frontend/web/js/toolbar/audits.js index 2b4290f0..93ecb389 100644 --- a/src/view/frontend/web/js/toolbar/audits.js +++ b/src/view/frontend/web/js/toolbar/audits.js @@ -15,7 +15,11 @@ const AUDIT_SETTLE_DELAY_MS = 200; * @returns {string} */ function escapeMdCode(selector) { - return selector.replace(/`/g, "'").replace(/\|/g, "\\|").replace(/\s+/g, " "); + return selector + .replace(/\\/g, "\\\\") + .replace(/`/g, "'") + .replace(/\|/g, "\\|") + .replace(/\s+/g, " "); } export const auditMethods = { From 42069a453084e9e82c7f4f083d7c003d474663c5 Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Fri, 13 Nov 2026 09:02:18 +0100 Subject: [PATCH 3/4] fix(toolbar): keep backslashes unchanged in markdown export selectors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/view/frontend/web/js/toolbar/audits.js | 6 +++-- website/build.mjs | 2 +- website/src/styles.css | 26 +++++++++++++--------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/view/frontend/web/js/toolbar/audits.js b/src/view/frontend/web/js/toolbar/audits.js index 93ecb389..43d0163f 100644 --- a/src/view/frontend/web/js/toolbar/audits.js +++ b/src/view/frontend/web/js/toolbar/audits.js @@ -15,10 +15,12 @@ const AUDIT_SETTLE_DELAY_MS = 200; * @returns {string} */ function escapeMdCode(selector) { + // Backslashes stay as-is: they are literal inside code spans. Only the table + // delimiter needs escaping. return selector - .replace(/\\/g, "\\\\") .replace(/`/g, "'") - .replace(/\|/g, "\\|") + .split("|") + .join("\\|") .replace(/\s+/g, " "); } diff --git a/website/build.mjs b/website/build.mjs index 0a591a8f..8dedc645 100644 --- a/website/build.mjs +++ b/website/build.mjs @@ -67,7 +67,7 @@ function upcomingSection() { const nextCommands = commands.filter((c) => !c.since); if (!features.length && !fixes.length && !nextCommands.length) return ""; const li = (i) => - `
  • ${i.scope ? `${e(i.scope)}` : ""}${e(i.text)}${i.pr ? ` Pull request #${e(i.pr)}` : ""}
  • `; + `
  • ${i.scope ? `${e(i.scope.toLowerCase())}` : ""}${e(i.text)}${i.pr ? ` Pull request #${e(i.pr)}` : ""}
  • `; return `

    On the anvil

    diff --git a/website/src/styles.css b/website/src/styles.css index 94bde5aa..5af9fc4d 100644 --- a/website/src/styles.css +++ b/website/src/styles.css @@ -854,11 +854,6 @@ dialog.search-dialog::backdrop { gap: 1.25rem; grid-template-columns: minmax(0, 1fr); } -@media (min-width: 56rem) { - .up-cols { - grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); - } -} .up-cols > div { background: rgb(26 11 4 / 0.92); color: #f6e9df; @@ -881,13 +876,24 @@ dialog.search-dialog::backdrop { gap: 0.6rem; } .up-list li { - display: flex; - flex-wrap: wrap; - gap: 0.4rem 0.6rem; + display: grid; + grid-template-columns: 8.5rem minmax(0, 1fr) auto; + gap: 0.25rem 0.75rem; align-items: baseline; } -.up-list li > span:not(.up-scope):not(.visually-hidden) { - flex: 1 1 14rem; +.up-list li > span:first-child:not(.up-scope) { + grid-column: 1 / 3; +} +.up-scope { + justify-self: start; +} +@media (max-width: 36rem) { + .up-list li { + grid-template-columns: minmax(0, 1fr) auto; + } + .up-list li > .up-scope { + grid-column: 1 / -1; + } } .up-list--quiet { font-size: 0.95rem; From 3f99f42a13d7204b4cfb60dda71aedb8a4e94008 Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Fri, 13 Nov 2026 09:03:21 +0100 Subject: [PATCH 4/4] fix(toolbar): remove unrelated website changes from this PR Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- website/build.mjs | 2 +- website/src/styles.css | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/website/build.mjs b/website/build.mjs index 8dedc645..0a591a8f 100644 --- a/website/build.mjs +++ b/website/build.mjs @@ -67,7 +67,7 @@ function upcomingSection() { const nextCommands = commands.filter((c) => !c.since); if (!features.length && !fixes.length && !nextCommands.length) return ""; const li = (i) => - `
  • ${i.scope ? `${e(i.scope.toLowerCase())}` : ""}${e(i.text)}${i.pr ? ` Pull request #${e(i.pr)}` : ""}
  • `; + `
  • ${i.scope ? `${e(i.scope)}` : ""}${e(i.text)}${i.pr ? ` Pull request #${e(i.pr)}` : ""}
  • `; return `

    On the anvil

    diff --git a/website/src/styles.css b/website/src/styles.css index 5af9fc4d..94bde5aa 100644 --- a/website/src/styles.css +++ b/website/src/styles.css @@ -854,6 +854,11 @@ dialog.search-dialog::backdrop { gap: 1.25rem; grid-template-columns: minmax(0, 1fr); } +@media (min-width: 56rem) { + .up-cols { + grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); + } +} .up-cols > div { background: rgb(26 11 4 / 0.92); color: #f6e9df; @@ -876,24 +881,13 @@ dialog.search-dialog::backdrop { gap: 0.6rem; } .up-list li { - display: grid; - grid-template-columns: 8.5rem minmax(0, 1fr) auto; - gap: 0.25rem 0.75rem; + display: flex; + flex-wrap: wrap; + gap: 0.4rem 0.6rem; align-items: baseline; } -.up-list li > span:first-child:not(.up-scope) { - grid-column: 1 / 3; -} -.up-scope { - justify-self: start; -} -@media (max-width: 36rem) { - .up-list li { - grid-template-columns: minmax(0, 1fr) auto; - } - .up-list li > .up-scope { - grid-column: 1 / -1; - } +.up-list li > span:not(.up-scope):not(.visually-hidden) { + flex: 1 1 14rem; } .up-list--quiet { font-size: 0.95rem;