-
Notifications
You must be signed in to change notification settings - Fork 26
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
Limit length of slug #11
Comments
truncate_slug/3 takes a slug like the ones that get generated by slugify/2 and a maximum_length and enforces that maximum length on the slug. I bumped the Elixir version since I used to_charlist which is the successor of the softdeprecated to_char_list, but is not available in Elixir 1.0. Fixes h4cc#11
I tried to implement this but, I just read that you wrote:
My implementation atm only does the latter. That aside I came here to ask whether I should bump the Elixir version (like I did) and use Edit: Now that I think about it, bumping the Elixir version should probably include bumping it in .travis.yml |
I have done a second commit on my branch that adds an option to handle both cases (with or without breaking inside a slugged word) and cleans the whole thing up a bit. Now a primarily need feedback regarding that Elixir version/ |
truncate_slug/3 takes a slug like the ones that get generated by slugify/2 and a maximum_length and enforces that maximum length on the slug. I bumped the Elixir version since I used to_charlist which is the successor of the softdeprecated to_char_list, but is not available in Elixir 1.0. Fixes h4cc#11
I added some tests that show some behaviour that might not be intended:
I assume that |
Provide a way to limit the length, with and without breaking inside a slugged word.
The text was updated successfully, but these errors were encountered: