[Glitch] Add option to not consider word boundaries when processing keyword filtering
Port 4c70bb6d6d
to glitch-soc
lolsob-rspec
parent
1966652cba
commit
aec11a568e
|
@ -45,7 +45,10 @@ export const regexFromFilters = filters => {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new RegExp(filters.map(filter => escapeRegExp(filter.get('phrase'))).map(expr => `\\b${expr}\\b`).join('|'), 'i');
|
return new RegExp(filters.map(filter => {
|
||||||
|
let expr = escapeRegExp(filter.get('phrase'));
|
||||||
|
return filter.get('whole_word') ? `\\b${expr}\\b` : expr;
|
||||||
|
}).join('|'), 'i');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const makeGetStatus = () => {
|
export const makeGetStatus = () => {
|
||||||
|
|
Loading…
Reference in New Issue