[PLT-7342] Add function and tests to specifically determine @all & @channel (#7181)
* add function and tests to specifically determine @all & @channel * uodate per comments - regex and tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
638c38cc0d
Коммит
4cf316fcd3
@@ -107,3 +107,12 @@ export function shouldShowDotMenu(post) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function containsAtMention(text, key) {
|
||||
if (!text || !key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// This doesn't work for at mentions containing periods or hyphens
|
||||
return new RegExp(`\\B${key}\\b`, 'i').test(text);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user