diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-07-09 22:13:52 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-07-10 14:06:04 +0200 |
commit | 6777dfc8d9567aa8cd23207ef44bdf38f4c17033 (patch) | |
tree | 8a83dbebf41e8c188122b997778f1d122f105341 /app/javascript/flavours/glitch/selectors | |
parent | 00c1386b9d30d77adabb7fcb099a7f11a23ac727 (diff) |
[Glitch] In keyword filter, account for reblogs, HTML and whole-words
Port 404c7702ec2a6576ef3b54f6a800624adfda9d53 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/selectors')
-rw-r--r-- | app/javascript/flavours/glitch/selectors/index.js | 2 |
1 files changed, 1 insertions, 1 deletions
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 = () => { |