-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
double dash bug #6
Comments
I think the bug here is that |
@ndimatteo you can close this issue and use https://github.com/dodo/node-slug/blob/master/src/slug.coffee#L71 which converts |
Well, it looks like it removes special characters, which I'm fine with, it's putting a double dash because once the special char is removed the space before it and after it are now right next to each other and each are converted to dashes. I was just thinking that after anything is removed that it should run another check for more than one space adjacent to one another and reduce, so that when it converts to dashes it's only one. I'm open to other suggestions though. |
@niftylettuce @ndimatteo I'll see about patching this soon - I'm using node-slugs in a new project and it needs some updates. |
Just add
after the last one in the replacement chain |
Unfortunately when unicode characters are removed, there will be multiple spaces adjacent to one another that are then converted to dashes, leading to multiple, adjacent dashes. For example:
'Links & Resources' -> 'links--resources'
There should be a check for multiple spaces and reduce to just one.
The text was updated successfully, but these errors were encountered: