Qfix: the numbers look like emojis (#8266)

This commit is contained in:
Alexander Platov 2025-03-19 03:50:20 +03:00 committed by GitHub
parent e16d6c73a2
commit 83fa1b7876
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,13 @@
}
nodes.forEach((node) => {
const reg = node.text?.match(/\P{Emoji}/gu)
matches.push(reg != null && reg.length > 0 && [65039, 65038, 8205].every((code) => code !== reg[0].charCodeAt(0)))
const regInc = node.text?.match(
/\p{Emoji}\uFE0F|\p{Emoji_Presentation}|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?/gu
)
matches.push(
(reg != null && reg.length > 0 && [65039, 65038, 8205].every((code) => code !== reg[0].charCodeAt(0))) ||
regInc == null
)
})
return matches.every((m) => !m)
}