From 1e6f16ab330d3aef289e04a615c5d25d37d7ae2e Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 2 May 2023 15:23:24 +0400 Subject: [PATCH] [Dev] Twemoji Parser: Added update instructions (#3131) --- src/lib/twemojiRegex.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/twemojiRegex.js b/src/lib/twemojiRegex.js index eb51f741e..551944f5f 100644 --- a/src/lib/twemojiRegex.js +++ b/src/lib/twemojiRegex.js @@ -3,7 +3,7 @@ // Version f8312f3 12.03.2022 const vs16RegExp = /\uFE0F/g; -// avoid using a string literal like '\u200D' here because minifiers expand it inline +// avoid using a string literal like `\u200D` here because minifiers expand it inline const zeroWidthJoiner = String.fromCharCode(0x200d); export function removeVS16s(rawEmoji) { @@ -11,9 +11,11 @@ export function removeVS16s(rawEmoji) { } // Default Twemoji regex was modified here. -// An exception for ascii emoji has been added to the beginning of the regular string: πŸ…°πŸ…±πŸ…ΎπŸ…Ώ -// UTF-16 endcoding are \ud83c\udd70, \ud83c\udd71,\ud83c\udd7e and \ud83c\udd7f +// An exception for ascii emoji has been added to the beginning of the regular string: πŸ…°πŸ…±πŸ…ΎπŸ…Ώ. +// UTF-16 endcoding are `\ud83c\udd70`, `\ud83c\udd71`, `\ud83c\udd7e` and `\ud83c\udd7f`. // These emojis in the graphic version must end with the `\ufe0f` symbol. +// Therefore, they should be excluded from the regular expression. +// You must remove next substring `\udd70\udd71\udd7e\udd7f` from the middle of the regex on every update. // This file is generated by source/emoji/scripts/generate.sh // eslint-disable-next-line max-len