From 6777dfc8d9567aa8cd23207ef44bdf38f4c17033 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 404c7702ec2a6576ef3b54f6a800624adfda9d53 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 d8dcbf8f2..7aa7569a0 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 = () => {