upd: change regex to support non-ascii characters

This commit is contained in:
Marie 2024-03-03 15:19:48 +00:00
parent 079b0dd655
commit 9318d6f003

View file

@ -621,12 +621,12 @@ export const language = P.createLanguage({
},
emojiCode: r => {
const side = P.notMatch(P.regexp(/[a-z0-9]/i));
const side = P.notMatch(P.regexp(/[\p{N}\p{L}]+/i));
const mark = P.str(':');
return P.seq([
P.alt([P.lineBegin, side]),
mark,
P.regexp(/[a-z0-9_+-]+/i),
P.regexp(/[_+\p{N}\p{L}-]+/i),
mark,
P.alt([P.lineEnd, side]),
], 2).map(name => M.EMOJI_CODE(name as string));