Preserve space before emoticon emoji (#9011)

This commit is contained in:
Anton Alexeyev
2025-05-21 19:06:53 +07:00
committed by GitHub
parent 255e03169c
commit 0e0c38b710
@@ -44,8 +44,13 @@ function handleEmoji (
if (!isValidEmojiPosition($from)) {
return
}
const emoji = getEmojiFunction(match.pop())
const emojiString = match.pop()
if (emojiString === undefined) return
const emoji = getEmojiFunction(emojiString)
if (emoji === undefined) return
if (match.length > 0) range.from = range.to - emojiString.length + 1
if (typeof emoji === 'string' || !isCustomEmoji(emoji)) {
commands.insertContentAt(range, [
{