fix ping regexp
This commit is contained in:
parent
361cbb4991
commit
53acf388a4
|
@ -53,7 +53,7 @@ const Chat = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const regExp = (ownName)
|
const regExp = (ownName)
|
||||||
? new RegExp(`(^|\\s+)(@${escapeRegExp(ownName)})(\\s+|$)`, 'g')
|
? new RegExp(`(^|\\s)(@${escapeRegExp(ownName)})(\\s|$)`, 'g')
|
||||||
: null;
|
: null;
|
||||||
setNameRegExp(regExp);
|
setNameRegExp(regExp);
|
||||||
}, [ownName]);
|
}, [ownName]);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
const linkRegExp = /(#[a-z]*,-?[0-9]*,-?[0-9]*(,-?[0-9]+)?)/gi;
|
const linkRegExp = /(#[a-z]*,-?[0-9]*,-?[0-9]*(,-?[0-9]+)?)/gi;
|
||||||
const linkRegExpFilter = (val, ind) => ((ind % 3) !== 2);
|
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 !== ''));
|
const spaceFilter = (val, ind) => (val !== ' ' && (ind !== 0 | val !== ''));
|
||||||
|
|
||||||
function splitChatMessageRegexp(
|
function splitChatMessageRegexp(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user