Merge pull request #4930 from jjaffeux/explicit-emoji-code
Explains sort/reverse of emoji replacements
This commit is contained in:
commit
27ca05d94c
|
@ -7,6 +7,7 @@ let _unicodeRegexp;
|
|||
export function setUnicodeReplacements(replacements) {
|
||||
_unicodeReplacements = replacements;
|
||||
if (replacements) {
|
||||
// We sort and reverse to match longer emoji sequences first
|
||||
_unicodeRegexp = new RegExp(Object.keys(replacements).sort().reverse().join("|"), "g");
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue