← back to Rentv
fix(topic-hubs): word-boundary hub-keyword matching so a mid-word substring can't mis-file an article — 'bank' no longer tags Burbank as lenders-banks, 'mall'∉small, 'sale'∉wholesale, 'loan'∉Sloan. Leading-\b keeps intentional prefixes (refinanc→refinancing, bank→bankruptcy); space-padded ' ai ' stays a whole word
cd119d7cd8ff4051ff3cbcf0b54619fd0db8b29c · 2026-08-06 10:35:48 -0700 · Steve
Files touched
Diff
commit cd119d7cd8ff4051ff3cbcf0b54619fd0db8b29c
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Aug 6 10:35:48 2026 -0700
fix(topic-hubs): word-boundary hub-keyword matching so a mid-word substring can't mis-file an article — 'bank' no longer tags Burbank as lenders-banks, 'mall'∉small, 'sale'∉wholesale, 'loan'∉Sloan. Leading-\b keeps intentional prefixes (refinanc→refinancing, bank→bankruptcy); space-padded ' ai ' stays a whole word
---
server.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server.js b/server.js
index 93441307..7473b035 100644
--- a/server.js
+++ b/server.js
@@ -1299,7 +1299,12 @@ const hubMatches = (hub, items) => {
const cat = String(a.cat || a.category || '').toLowerCase();
if (cats.includes(cat)) return true;
const title = ' ' + String(a.title || '').toLowerCase() + ' ';
- return kws.some(k => title.includes(k));
+ // Word-boundary the keyword so a mid-word substring can't false-tag an article: "bank" must not
+ // match "Burbank", "mall" not "small", "sale" not "wholesale", "loan" not "Sloan". A bare keyword
+ // keeps only a LEADING \b so intentional prefixes still match ("refinanc"→refinancing, "bank"→
+ // bankruptcy); a keyword the author space-padded (" ai ") gets a trailing \b too — a true whole word.
+ return kws.some(k => { const kt = k.trim(); if (!kt) return false;
+ return new RegExp('\\b' + kt.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + (k !== kt ? '\\b' : '')).test(title); });
});
};
const findHub = slug => (readHubs().hubs || []).find(h => h.slug === slug) || null;
← 1280b163 nav: add /deals-log (Deals Log) to map hamburger + Explore d
·
back to Rentv
·
rentv front page: drawer groups collapse on load — click a t faad4bab →