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

Separate capitalized words #36

Merged
merged 2 commits into from
Jan 21, 2020

Conversation

TiagoDanin
Copy link
Contributor

Separates capitalized words (FOObar ~> foo-bar).
Regex101 Test: https://regex101.com/r/IraTqG/1

Fixes #31
Fixes #35

Verified

This commit was signed with the committer’s verified signature. The key has expired.
LnL7 Daiderd Jordan
@davalapar
Copy link

Hi sir @sindresorhus is this good for merge 🙏 🙏

@sindresorhus sindresorhus changed the title Separates capitalized words Separate capitalized words Jan 21, 2020
@sindresorhus sindresorhus merged commit 9122e57 into sindresorhus:master Jan 21, 2020
@ryanto
Copy link

ryanto commented Feb 11, 2020

Looks like this one changed generating slugs for acronym + word combos.

v0.9.1: slugify('JSONAPISerializer') // => 'jsonapi-serializer'
v0.10.0: slugify('JSONAPISerializer') // => 'jsonapis-erializer'

I'm not sure what the correct behavior should be here, but if v0.10.0 is correct is there anyway to use options to reproduce the old output?

Thanks!

@sindresorhus
Copy link
Owner

The 0.9.1 behavior is the correct one.

@TiagoDanin ^

@TiagoDanin
Copy link
Contributor Author

@sindresorhus Should I disregard #35?

@darsain
Copy link

darsain commented Jun 5, 2021

Maybe I'm shouting into the void as this is long merged, but another edge case is a plural of an acronym:

slugify('Util APIs'); // util-api-s

Which I'd like to rather be util-apis. Would it be possible to detect plural form and ignore decamelization in this case?

I can't just disable it altogetehr as I'm using a single incrementing slugify instance that should be decamelizing.

@sindresorhus
Copy link
Owner

Open a new issue.

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

Successfully merging this pull request may close these issues.

All Caps cause incorrect dashes! Incorrect dashes
5 participants