1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-25 08:46:25 +00:00

Fix FakeNitro hyperlinks not working sometimes

It is caused by emoji names with conflict with default emojis, but have a letter capitalized
This commit is contained in:
Nuckyz 2024-02-14 15:16:31 -03:00 committed by Luna
parent 4b4d37b7a9
commit 541ab1eb0f

View file

@ -838,7 +838,7 @@ export default definePlugin({
url.searchParams.set("name", emoji.name);
messageObj.content = messageObj.content.replace(emojiString, (match, offset, origStr) => {
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[:${emoji.name}:](${url})` : url}${getWordBoundary(origStr, offset + match.length)}`;
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[${emoji.name}](${url})` : url}${getWordBoundary(origStr, offset + match.length)}`;
});
}
}
@ -864,7 +864,7 @@ export default definePlugin({
url.searchParams.set("size", s.emojiSize.toString());
url.searchParams.set("name", emoji.name);
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[:${emoji.name}:](${url})` : url}${getWordBoundary(origStr, offset + emojiStr.length)}`;
return `${getWordBoundary(origStr, offset - 1)}${s.useHyperLinks ? `[${emoji.name}](${url})` : url}${getWordBoundary(origStr, offset + emojiStr.length)}`;
});
});
},