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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,8 +44,13 @@ function handleEmoji (
if (!isValidEmojiPosition($from)) { if (!isValidEmojiPosition($from)) {
return return
} }
const emoji = getEmojiFunction(match.pop())
const emojiString = match.pop()
if (emojiString === undefined) return
const emoji = getEmojiFunction(emojiString)
if (emoji === undefined) return if (emoji === undefined) return
if (match.length > 0) range.from = range.to - emojiString.length + 1
if (typeof emoji === 'string' || !isCustomEmoji(emoji)) { if (typeof emoji === 'string' || !isCustomEmoji(emoji)) {
commands.insertContentAt(range, [ commands.insertContentAt(range, [
{ {