Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/String/Extra.elm
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,14 @@ camelizeRegex =


{-| Convert a string to a camelized string starting with an uppercase letter.
All non-word characters will be stripped out of the original string.
All non-alphanumeric characters will be stripped out of the original string.

classify "some_class_name" --> "SomeClassName"

classify "myLittleCamel.class.name" --> "MyLittleCamelClassName"

classify "München" --> "MNchen"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... is there ever a point where this is desirable behavior? And is there a way to fix it or is this one of those parts of Elm where there isn't really a great workaround?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not desirable, no, but we can't fix it without some form of unicode support, and the only current path (elm-unicode) would add an unacceptable size to the bundle.

I prefer to document it rather than leave it as a surprise though.

The "clean" fix would be to have a new version of elm/regex with support for enabling the unicode flag.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks for the explanation.


-}
classify : String -> String
classify string =
Expand Down