Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Turn a string into a slug
export function handleize (str) {
return str
.toLowerCase()
.replace(/[^\w\u00C0-\u024f]+/g, '-')
.replace(/^-+|-+$/g, '')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment