mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-27 00:53:11 +00:00
Fix infinite loop when system emoji font is enabled (#1931)
Fixes #1930
This commit is contained in:
parent
e589afa0ef
commit
ceafd1f68f
|
@ -30,11 +30,11 @@ const emojifyTextNode = (node, customEmojis) => {
|
|||
let match, i = 0;
|
||||
|
||||
if (customEmojis === null) {
|
||||
while (i < str.length && !(match = trie.search(str.slice(i)))) {
|
||||
while (i < str.length && (useSystemEmojiFont || !(match = trie.search(str.slice(i))))) {
|
||||
i += str.codePointAt(i) < 65536 ? 1 : 2;
|
||||
}
|
||||
} else {
|
||||
while (i < str.length && str[i] !== ':' && !(match = trie.search(str.slice(i)))) {
|
||||
while (i < str.length && str[i] !== ':' && (useSystemEmojiFont || !(match = trie.search(str.slice(i))))) {
|
||||
i += str.codePointAt(i) < 65536 ? 1 : 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue