Skip to content

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.

@netlify
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