improve channel mentions (#146)

something like @; was crashing the app.
this should be better.
This commit is contained in:
jessopb 2021-10-27 21:21:40 -04:00 committed by GitHub
parent c24153c6ca
commit 1a5fb5fa51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,9 +7,9 @@ export const punctuationMarks = [',', '.', '!', '?', ':', ';', '-', ']', ')', '}
const mentionToken = '@'; const mentionToken = '@';
// const mentionTokenCode = 64; // @ // const mentionTokenCode = 64; // @
const mentionRegex = /@[^\s()"]*/gm;
const invalidRegex = /[-_.+=?!@#$%^&*:;,{}<>\w/\\]/; const invalidRegex = /[-_.+=?!@#$%^&*:;,{}<>\w/\\]/;
const mentionRegex = /@[^\s()"-_.+=?!@$%^&*;,{}<>/\\]*/gm;
function handlePunctuation(value) { function handlePunctuation(value) {
const protocolIndex = value.indexOf('lbry://') === 0 ? protocol.length - 1 : 0; const protocolIndex = value.indexOf('lbry://') === 0 ? protocol.length - 1 : 0;