Closed n-rook closed 7 years ago
I would be totally on board with submitting a PR for this by the way. I'm not sure what the right interface for it is, though. Something as literal as underscore: false
? Or something more general?
you can replace before call SpeakingURL, something like:
var getSlug = require('speakingurl');
var foo = "Schöner_Titel_läßt_grüßen!?";
var slug = getSlug(foo.replace('_', '-');
console.log(slug);
or if you have to remove _ and not convert to dashes, you can try:
var slug = getSlug(foo.replace('_', '');
Use the custom
option:
getSlug('Schöner_Titel_läßt_grüßen!?', { custom:{'_': '-'} } )
Ah, you're right. I hadn't realized custom
would still work on hyphens or underscores. Thanks!
Today I learned underscores aren't allowed in domain hostnames! Whoops. As such, I'd like an option to get rid of underscores, and replace them with hyphens.