-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
dot "." is legal in a URL but it is replaced with "-" #55
Comments
There are lots of characters that are allowed in a URL that are replaced by a dash. That's how slugification usually works. We could potentially add an option with an array of characters to preserve, but as a user, I think |
As I understands, slugify should work nice with filenames, and having a dot in the filename can change how it is opened by default |
A setting with characters to preserve would be great! |
I also encountered this issue during migration of a blog. In a previous system we used «underscore» as valid part of slug. And now in Gatsby it's impossible to save previous structure/paths. Would be really awesome to see this improvement. |
@sindresorhus If you okay with a proposal to add an option to preserve some characters, I can make a PR p.s. oh crap, just noticed that you're on a vacation, sry :) |
PR welcome. You can use 2aa5659 as an example of what's expected of the PR. |
Also I noticed, that Gatsby uses v.1.x.x of |
Hello @sindresorhus . Is it still perhaps possible to create a function that preserves a dot "." in the url? :/ |
HI Sindre
I have been using your slugify and I find it very useful. So thank you for offering it.
I discovered that a url containing a dot is converted. Eg:
version3.1 is converted to version3-1
This created problems when I'm creating slugs for URLs like https://api.insightly.com/v3.1/Help
According to the spec of url written by Tim Berners-Lee back in 1994 it is legal to have a dot "." (punktum) in a url.
https://www.w3.org/Addressing/URL/url-spec.txt
Is there a way to instruct slugify to not convert "." to "-" ?
The text was updated successfully, but these errors were encountered: