From e7fcd850b08e4a7bf8466e3751c08ef48074d39a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Feb 2026 21:32:37 +0000 Subject: [PATCH 1/2] Fix wildcard matching: allow apostrophes in contractions - Changed * and ? wildcards to allow apostrophes (straight ' and curly '') - Fixes "d*t work" not matching "Didn't work" - Pattern `d*t` now correctly matches across apostrophes in contractions - Updated both matcher-core.js and tools/matcher.js https://claude.ai/code/session_01D2bZpGzXV1gjhhYv4Mc4zw --- extension/matcher-core.js | 9 ++++++--- tools/matcher.js | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/extension/matcher-core.js b/extension/matcher-core.js index a4bdfb3..c854ae0 100644 --- a/extension/matcher-core.js +++ b/extension/matcher-core.js @@ -114,12 +114,15 @@ if (prev === " " && next === " ") { result += "[^\\s]+"; } else if (isFirst || isLast) { - result += "[^\\s\\p{P}]*"; + // Allow apostrophes (straight and curly) for contractions like "didn't" + result += "(?:[^\\s\\p{P}]|['''])*"; } else { - result += "[^\\s\\p{P}]*?"; + // Middle wildcard: non-greedy, allow apostrophes + result += "(?:[^\\s\\p{P}]|['''])*?"; } } else if (ch === "?") { - result += "[\\s\\S]"; + // Single char wildcard - also allow apostrophes + result += "(?:[^\\s\\p{P}]|['''])"; } else if (ch === " ") { result += "\\s+"; } else { diff --git a/tools/matcher.js b/tools/matcher.js index b549d6e..159c376 100644 --- a/tools/matcher.js +++ b/tools/matcher.js @@ -110,12 +110,15 @@ function globToRegexFragment(pattern) { if (prev === " " && next === " ") { result += "[^\\s]+"; } else if (isFirst || isLast) { - result += "[^\\s\\p{P}]*"; + // Allow apostrophes (straight and curly) for contractions like "didn't" + result += "(?:[^\\s\\p{P}]|['''])*"; } else { - result += "[^\\s\\p{P}]*?"; + // Middle wildcard: non-greedy, allow apostrophes + result += "(?:[^\\s\\p{P}]|['''])*?"; } } else if (ch === "?") { - result += "[\\s\\S]"; + // Single char wildcard - also allow apostrophes + result += "(?:[^\\s\\p{P}]|['''])"; } else if (ch === " ") { result += "\\s+"; } else { From 9471754367fb0362c93edd418e6d8b6b41635fa1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Feb 2026 02:35:40 +0000 Subject: [PATCH 2/2] Fix client content type detection for Image/Profile/Question overrides The old selector `.navbar-inner .decisionAreaLabel` doesn't exist on the real CMS. Added new detection that finds `
contentType
` followed by `
Image
` (or Profile/Question). This fixes client header highlighting not using Image/Profile/Question overrides when viewing those content types. https://claude.ai/code/session_01D2bZpGzXV1gjhhYv4Mc4zw --- extension/content.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/extension/content.js b/extension/content.js index d6780fd..5de00e5 100644 --- a/extension/content.js +++ b/extension/content.js @@ -64,12 +64,31 @@ } function getCmsContentType() { - const el = document.querySelector(".navbar-inner .decisionAreaLabel"); - const raw = el ? String(el.textContent || "").trim().toLowerCase() : ""; + // Try the old selector first (for backwards compatibility) + let el = document.querySelector(".navbar-inner .decisionAreaLabel"); + if (el) { + const raw = String(el.textContent || "").trim().toLowerCase(); + if (raw.includes("image")) return "Image"; + if (raw.includes("profile")) return "Profile"; + if (raw.includes("question")) return "Question"; + return "Default"; + } + + // New selector: find
contentType
and get the next
sibling + const dtElements = document.querySelectorAll("dt"); + for (const dt of dtElements) { + if (dt.textContent.trim().toLowerCase() === "contenttype") { + const dd = dt.nextElementSibling; + if (dd && dd.tagName === "DD") { + const raw = String(dd.textContent || "").trim().toLowerCase(); + if (raw.includes("image")) return "Image"; + if (raw.includes("profile")) return "Profile"; + if (raw.includes("question")) return "Question"; + } + break; + } + } - if (raw.includes("image")) return "Image"; - if (raw.includes("profile")) return "Profile"; - if (raw.includes("question")) return "Question"; return "Default"; }