From 032b2f4bd557da117150dda1840adea20e703919 Mon Sep 17 00:00:00 2001 From: Elie Habib Date: Fri, 27 Feb 2026 16:07:44 +0400 Subject: [PATCH] fix(scripts): handle escaped apostrophes in feed name regex nameRe used [^']+ which stopped at \' in source text, truncating names like L'Orient-Le Jour to "L\" and Lenny's Newsletter to "Lenny\". Use (?:[^'\\]|\\.)* to skip escape sequences. Also removed stray + quantifier after closing quote. --- scripts/validate-rss-feeds.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/validate-rss-feeds.mjs b/scripts/validate-rss-feeds.mjs index 6e7ac9d0a..765b01ab5 100644 --- a/scripts/validate-rss-feeds.mjs +++ b/scripts/validate-rss-feeds.mjs @@ -20,8 +20,8 @@ function extractFeeds() { // Match rss('url') or railwayRss('url') — capture raw URL const rssUrlRe = /(?:rss|railwayRss)\(\s*'([^']+)'\s*\)/g; - // Match name: 'X' or name: "X" (Tom's Hardware uses double quotes) - const nameRe = /name:\s*(?:'([^']+)'+|"([^"]+)")/; + // Match name: 'X' or name: "X" — handles escaped apostrophes (L\'Orient-Le Jour) + const nameRe = /name:\s*(?:'((?:[^'\\]|\\.)*)'|"([^"]+)")/; // Match lang key like `en: rss(`, `fr: rss(` — find all on a line with positions const langKeyAllRe = /(?:^|[\s{,])([a-z]{2}):\s*(?:rss|railwayRss)\(/g;