fix ping regexp

This commit is contained in:
HF 2020-05-15 08:23:10 +02:00
parent 361cbb4991
commit 53acf388a4
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ const Chat = ({
useEffect(() => {
const regExp = (ownName)
? new RegExp(`(^|\\s+)(@${escapeRegExp(ownName)})(\\s+|$)`, 'g')
? new RegExp(`(^|\\s)(@${escapeRegExp(ownName)})(\\s|$)`, 'g')
: null;
setNameRegExp(regExp);
}, [ownName]);

View File

@ -17,7 +17,7 @@
*/
const linkRegExp = /(#[a-z]*,-?[0-9]*,-?[0-9]*(,-?[0-9]+)?)/gi;
const linkRegExpFilter = (val, ind) => ((ind % 3) !== 2);
const mentionRegExp = /(^|\s+)(@\S+)/g;
const mentionRegExp = /(^|\s)(@\S+)/g;
const spaceFilter = (val, ind) => (val !== ' ' && (ind !== 0 | val !== ''));
function splitChatMessageRegexp(