From 1966652cbacfe8433cd97918129d0f78e68f1a15 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 9 Jul 2018 22:13:52 +0200 Subject: [PATCH] [Glitch] In keyword filter, account for reblogs, HTML and whole-words Port 6084257fda2305b2ac3ac739e1a55bb27b13293a to glitch-soc --- app/javascript/flavours/glitch/selectors/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js index d8dcbf8f23..7aa7569a05 100644 --- a/app/javascript/flavours/glitch/selectors/index.js +++ b/app/javascript/flavours/glitch/selectors/index.js @@ -45,7 +45,7 @@ export const regexFromFilters = filters => { return null; } - return new RegExp(filters.map(filter => escapeRegExp(filter.get('phrase'))).join('|'), 'i'); + return new RegExp(filters.map(filter => escapeRegExp(filter.get('phrase'))).map(expr => `\\b${expr}\\b`).join('|'), 'i'); }; export const makeGetStatus = () => {