You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rather than converting don't and can't to don-t and can-t, consider adding a custom conversion from "'" to "" for English to turn them into dont and cant respectively.
In the odd case where single quotes are used as an actual quotation, they are typically surrounded by spaces:
Isn't this an 'example'?
would become
isnt-this-an-example
The text was updated successfully, but these errors were encountered:
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.
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.
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
The text was updated successfully, but these errors were encountered: