Closed nightpool closed 2 years ago
master
GUI (Graphical User Interface), CLI (Command Line Interface)
JSON
When generating Twemoji URLs, Emoji.cs will skip all 0xfe0f sequences:
https://github.com/Tyrrrz/DiscordChatExporter/blob/36c9983c9ecc8609877f4afa3ed455b62ad6a0b0/DiscordChatExporter.Core/Discord/Data/Emoji.cs#L29-L32
However, this is incorrect based on Twemoji's URL generation code. See https://github.com/twitter/twemoji/issues/419. The logic for generating Twemoji URLs live here:
https://github.com/twitter/twemoji-parser/blob/f8312f35fdee0e79874bb50213c4544c14fa759b/src/index.js#L52-L56
Specifically, we should only remove 0xfe0f codepoints when the emoji sequence does not contain a zero width joiner (0x200d)
0xfe0f
0x200d
The correct URL is https://twemoji.maxcdn.com/2/svg/1f575-fe0f-200d-2640-fe0f.svg
Thanks for the very descriptive bug report đđť Happy to accept a PR on this
Version
master
Flavor
GUI (Graphical User Interface), CLI (Command Line Interface)
Export format
JSON
Details
When generating Twemoji URLs, Emoji.cs will skip all 0xfe0f sequences:
https://github.com/Tyrrrz/DiscordChatExporter/blob/36c9983c9ecc8609877f4afa3ed455b62ad6a0b0/DiscordChatExporter.Core/Discord/Data/Emoji.cs#L29-L32
However, this is incorrect based on Twemoji's URL generation code. See https://github.com/twitter/twemoji/issues/419. The logic for generating Twemoji URLs live here:
https://github.com/twitter/twemoji-parser/blob/f8312f35fdee0e79874bb50213c4544c14fa759b/src/index.js#L52-L56
Specifically, we should only remove
0xfe0f
codepoints when the emoji sequence does not contain a zero width joiner (0x200d
)Steps to reproduce
The correct URL is https://twemoji.maxcdn.com/2/svg/1f575-fe0f-200d-2640-fe0f.svg