mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge pull request #1183 from girishso/strip-extra-s
strip extra hyphens from urls
This commit is contained in:
@@ -20,6 +20,7 @@ export function isEmail(email) {
|
||||
|
||||
export function cleanUpUrlable(input) {
|
||||
var cleaned = input.trim().replace(/-/g, ' ').replace(/[^\w\s]/gi, '').toLowerCase().replace(/\s/g, '-');
|
||||
cleaned = cleaned.replace(/-{2,}/, '-');
|
||||
cleaned = cleaned.replace(/^\-+/, '');
|
||||
cleaned = cleaned.replace(/\-+$/, '');
|
||||
return cleaned;
|
||||
|
||||
Reference in New Issue
Block a user