Open zzzzBov opened 7 years ago
It's not a quick change. Because of this config option mark
and the order of replacements.
In short, at the moment I haven't the time for deeper changes, so I would recommend to go with this solution:
var options = {
custom: {
"'": ""
}
};
var mySlug = require('speakingurl').createSlug(options);
var slug = mySlug("Isn't this an 'example'?");
console.log(slug); // Output: isnt-this-an-example
I use it all the time to configure an own project specific slug-function.
Hope it helps; if you have the time to send a pull request, feel free ;-) I think it would be a nice feature.
@pid
Thanks for the response. I've already been using the {custom:...}
solution, but I figured I'd call out the possibility for improvement around this feature.
I think that having this built in would be nice. I don't see why anyone would want foo-s
vs. foos
.
rather than converting
don't
andcan't
todon-t
andcan-t
, consider adding a custom conversion from"'"
to""
for English to turn them intodont
andcant
respectively.In the odd case where single quotes are used as an actual quotation, they are typically surrounded by spaces:
would become