0
0
Fork 0

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
This commit is contained in:
Eugen Rochko 2018-07-06 02:15:44 +02:00 committed by GitHub
parent 17b928502a
commit 404c7702ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -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 = () => {