-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Changes breaking text in congrats-bot.mjs script #1653
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
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
scripts/congrats-bot.mjs
Outdated
@@ -9,7 +9,7 @@ setDiscordMessage(COMMIT_AUTHOR, COMMIT_ID, COMMIT_MESSAGE); | |||
* @param {string} commitMsg A full commit message | |||
*/ | |||
function setDiscordMessage(author, id, commitMsg) { | |||
const commitMessage = commitMsg.split('\n').shift().replaceAll('`', ''); | |||
const commitMessage = commitMsg.split('\n').shift().replaceAll('`', '').replaceAll('--', '––'); |
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.
Interesting. Didn’t think of this approach!
I think we can even go one better:
const commitMessage = commitMsg.split('\n').shift().replaceAll('`', '').replaceAll('--', '––'); | |
const commitMessage = commitMsg.split('\n').shift().replaceAll('`', '').replaceAll('--', '--'); |
Very hard to see, but I’ve added a zero-width space between the two hyphens. What do you think?
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.
Sounds like an even smoother approach! Added it!
The only worry is discord might not read it as a character, but from my test, it seems to.
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.
Thanks! Lucky we have a PR open at the moment that we can test this with when it merges, so I'll get this merged now and we can revisit if there any problems.
Welcome to Team Docs @Lofty-Brambles!
* Escapes breaking text in congrats-bot.mjs script * Change escaping method with zero-width space Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
What kind of changes does this PR include?
--
with––
instead, as to not break discord markdown.Description
--flags
in Discord CongratsBot #1615