pid / speakingurl

Generate a slug – transliteration with a lot of options
http://pid.github.io/speakingurl/
BSD 3-Clause "New" or "Revised" License
1.12k stars 84 forks source link

Clarify how to allow additional characters #115

Closed niftylettuce closed 6 years ago

niftylettuce commented 6 years ago

I wanted to allow the extra character / (a forward slash).

I attempted to use custom: [ '/' ] however this did not work.

The only solution I found currently was uric: true, but that does not satisfy my requirements, since I only want to allow the / and not all other URI characters.

@pid how do we solve this?

leocaseiro commented 6 years ago

Hi @niftylettuce, you can use the custom parameter, like so:

getSlug(text, {
    custom: {'/': '/'}
});

See example http://plnkr.co/edit/PKTPa5SWnoXiDoMWFHLW?p=preview

pid commented 6 years ago

@leocaseiro thanks for support