From 404c7702ec2a6576ef3b54f6a800624adfda9d53 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 6 Jul 2018 02:15:44 +0200 Subject: In keyword filter, account for reblogs, HTML and whole-words (#7960) * In keyword filter, account for reblogs, HTML and whole-words * Match whole words in JS filter, too * Fix typo --- app/javascript/mastodon/selectors/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/selectors/index.js b/app/javascript/mastodon/selectors/index.js index 56eca1f02..ba9777eba 100644 --- a/app/javascript/mastodon/selectors/index.js +++ b/app/javascript/mastodon/selectors/index.js @@ -43,7 +43,7 @@ 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 = () => { -- cgit