LuckPermsWeb icon indicating copy to clipboard operation
LuckPermsWeb copied to clipboard

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

Open BNTFryingPan opened this issue 1 year ago • 4 comments

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.

BNTFryingPan avatar Mar 26 '24 20:03 BNTFryingPan

Deploy Preview for luckperms ready!

Name Link
Latest commit 1db385c8b4e58e4be9302aa13a8ae9a5682904c2
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.

netlify[bot] avatar Mar 26 '24 21:03 netlify[bot]

preview:

https://github.com/LuckPerms/LuckPermsWeb/assets/7706960/d5abc8a1-5a3e-4386-9fb7-288f3ae086c9

BNTFryingPan avatar Mar 26 '24 21:03 BNTFryingPan

replaceAll() is a thing, too.

Turbotailz avatar May 27 '24 11:05 Turbotailz

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

BNTFryingPan avatar May 27 '24 14:05 BNTFryingPan