Skip to content
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

Removing punctuation #5

Closed
jhchen opened this issue Dec 22, 2017 · 1 comment
Closed

Removing punctuation #5

jhchen opened this issue Dec 22, 2017 · 1 comment

Comments

@jhchen
Copy link
Contributor

jhchen commented Dec 22, 2017

From the Wikipedia page linked from kebab_case.ex it says "As per snake_case above" and in the snake_case section above it says "Punctuation is removed and spaces are replaced..." However it looks like in this project's tests for kebab_case it seems to intentionally test for preservation of punctuation https://github.com/sobolevn/recase/blob/master/test/recase_test/kebab_case_test.exs#L18

My understanding of kebab case (and other cases) is that punctation should be removed and consecutive punctation is collapsed into one hyphen. This is for example what lodash does for their string conversion suite and this definition of kebab case seems supported by this project's own comment link to Wikipedia.

So for one I wanted to ask to clarify on what is the correct behavior. If punctuation should be preserved then the link to Wikipedia should be removed as it does not describe the functionality of the functions implemented by this project. If they should be removed then I'm happy to submit a PR changing this and updating the tests.

In case it is helpful the use case I have is generating urls for titles (user generated) and preserving punctation is of course problematic for urls.

@sobolevn
Copy link
Member

@jhchen thanks for the detailed issue!
I guess you are right, it should be removed.

A PR with the fix will be an awesome contribution!

@jhchen jhchen mentioned this issue Jan 9, 2018
@jhchen jhchen closed this as completed Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants