Normalize string in different formats
slug will remove all diacritics and punctuation, lowercase the string,
collapse spaces and replace them with hyphens. Trailing and leading hyphens
will be removed.
slug "Écoute la vie!" -> "ecoute-la-vie"
slug "(this is not interesting!)" -> "this-is-not-interesting"
slug "é()/& abc -" --> "e-abc"slug will remove all diacritics and punctuation, lowercase the string,
collapse spaces and replace them with hyphens. Trailing and leading hyphens
will be removed.
slug "Écoute la vie!" -> "ecoute-la-vie"
slug "(this is not interesting!)" -> "this-is-not-interesting"
slug "é()/& abc -" --> "e-abc"filename is similar to slug but will use underscores
instead of hypens, it will also preserve the file extension. The file
extension will be lowercased.
filename "J'aime les fruits/et les amours .MP3" -->
"j_aime_les_fruits_et_les_amours.mp3"path is similar to filename but will preserve slash.
path "J'aime les fruits/et les amours .MP3" -->
"j_aime_les_fruits/et_les_amours.mp3"removeDiacritics removes diactritics, it will expand
known ligatures, thus changing the string glyph length.
All non latin characters are untouched.
removeDiacritics "La liberté commence où l'ignorance finit."
--> "La liberte commence ou l'ignorance finit."
removeDiacritics "é()/& abc" --> "e()/& abc"
removeDiacritics "こんにちは" --> "こんにちは"
urlis similar toslugbut will preserve slashes.