Skip to content
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

replace all spaces in group/track names and not just the first one #468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BNTFryingPan
Copy link
Member

fixes LuckPerms/LuckPerms#3865

String.prototype.replace() in JavaScript only replaces the first occurrence when the first argument provided is a string. If text with multiple spaces was pasted into the box, only the first one would get replaced. This PR replaces the " " with a global regex / /g so all occurrences will get replaced.

Copy link

netlify bot commented Mar 26, 2024

Deploy Preview for luckperms ready!

Name Link
🔨 Latest commit 1db385c
🔍 Latest deploy log https://app.netlify.com/sites/luckperms/deploys/6603374e85c7ae0008b6f3fc
😎 Deploy Preview https://deploy-preview-468--luckperms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@BNTFryingPan
Copy link
Member Author

preview:

luckperms-webeditor-spaces-fix.mp4

@Turbotailz
Copy link
Member

replaceAll() is a thing, too.

@BNTFryingPan
Copy link
Member Author

think of the 2.1% of web users that only have replace and not replaceAll!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Group name having spaces
2 participants