Fix remark emote (#635)

This commit is contained in:
saltrafael 2022-01-06 11:34:00 -03:00 committed by GitHub
parent fc58dc5ef4
commit 1eaa172a1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ function findNextEmote(value, fromIndex, strictlyFromIndex) {
const str = match[0];
if (EMOTES.some(({ name }) => str.toUpperCase() === name)) {
if (EMOTES.some(({ name }) => str === name)) {
// Profit!
return { text: str, index: match.index };
}
@ -99,7 +99,7 @@ export function inlineEmote() {
const transformer = (node, index, parent) => {
if (node.type === EMOTE_NODE_TYPE && parent && parent.type === 'paragraph') {
const emoteStr = node.value;
const emote = EMOTES.find(({ name }) => emoteStr.toUpperCase() === name);
const emote = EMOTES.find(({ name }) => emoteStr === name);
node.type = 'image';
node.url = emote.url;