-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(formatters): Change :_:
emoji name placeholder
#10567
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10567 +/- ##
==========================================
+ Coverage 38.01% 38.02% +0.01%
==========================================
Files 239 239
Lines 15471 15466 -5
Branches 1353 1353
==========================================
Hits 5881 5881
+ Misses 9575 9570 -5
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would rather keep this as-is for the current minor version and make name
required in the future. Thoughts? @vladfrangu @almeidx
🤷. We can also just have a fallback on |
Please describe the changes this PR makes and why it should be merged:
Discord doesn't verify emoji names, meaning you only actually need to include a valid ID for an emoji to display properly. Discord.js uses
_
as a fallback name when formatting emojis with just an ID. However, since_
is not a valid emoji name, if you were to parse that emoji, it would fail, which could be unexpected behavior.Additionally, if you were to have multiple emojis with the
_
name placeholder and invalid IDs (or if the bot doesn't have access to the emoji), they fail to render in Discord and the text between them becomes unintentionally italicized. For example,<:_:123678901234578> foobar <:_:123678901234578>
This is another unintentional side-effect of using
:_:
as a placeholder emoji name that end-users currently have to look out for.To fix this, I changed the
:_:
placeholder to:emoji:
. This way it is a valid emoji name that parses correctly and doesn't interfere with any other Markdown features. Originally, I was going to change it to:__:
, which would parse correctly, but causes text between invalid emojis to be underlined.In my opinion,
parseEmoji
should also be changed to properly support emojis that used:_:
in the past, because even though it's not a valid emoji name, it does still render correctly, but people in the support server disagreedStatus and versioning classification: