fix: get custom emoji id from title attribute (#1871)

This commit is contained in:
Vjacheslav Trushkin 2023-03-08 22:19:53 +02:00 committed by GitHub
parent c76e8e8f5e
commit fa3cfd6059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,7 +219,7 @@ export function treeToText(input: Node): string {
if (input.name === 'img' || input.name === 'picture') { if (input.name === 'img' || input.name === 'picture') {
if (input.attributes.class?.includes('custom-emoji')) if (input.attributes.class?.includes('custom-emoji'))
return `:${input.attributes['data-emoji-id']}:` return `:${input.attributes['data-emoji-id'] || input.attributes.title}:`
if (input.attributes.class?.includes('iconify-emoji')) if (input.attributes.class?.includes('iconify-emoji'))
return input.attributes.alt return input.attributes.alt
} }