Created
May 31, 2019 18:51
-
-
Save prykon/00eb3c4ef0c8658f1413368e1df7f07c to your computer and use it in GitHub Desktop.
UDF - SEO Friendly URL Slug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slug(input) { | |
input = input.toLowerCase(); | |
input = input.replace(/\s+/g, "-"); | |
input = input.replace(/[&\/\\#,+()$~%.'":*¿?¡!<>{}]/g, ''); | |
return input; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment