Skip to content

Fix broken composition with class names that contain characters other than [A-Za-z0-9_] #96

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

Merged
merged 1 commit into from
Jul 14, 2015

Conversation

rtsao
Copy link
Contributor

@rtsao rtsao commented Jul 8, 2015

Class composition is broken with "non-word" (\w) characters due to the regex used to split tokens.

Perfectly valid classes such as .my-class or .mycläss are broken as they get split up.

This PR updates the regex to use \S instead of \wwhich allows these characters and thus fixes the problem.

Additionally, a test has been added to verify composition works with a class that contains a hyphen (which fails without the updated regex).

@rtsao rtsao force-pushed the fix-class-names branch from 3a3afff to 1987647 Compare July 8, 2015 04:29
@rtsao rtsao changed the title Fix broken class composition with class names that contain characters other than [A-Za-z0-9_] Fix broken composition with class names that contain characters other than [A-Za-z0-9_] Jul 8, 2015
@noamlerner
Copy link

This is awesome!

@marthakelly
Copy link

This would really help out a project we're working on at Uber! Please let us know if we can do anything to help get this merged, or anything you'd like changed before we do that.

+1

@freeqaz
Copy link

freeqaz commented Jul 14, 2015

+1

@freeqaz
Copy link

freeqaz commented Jul 14, 2015

.über

markdalgleish added a commit that referenced this pull request Jul 14, 2015
Fix broken composition with class names that contain characters other than [A-Za-z0-9_]
@markdalgleish markdalgleish merged commit a2f1ada into webpack-contrib:master Jul 14, 2015
@markdalgleish
Copy link
Contributor

Merged, published as v0.5.14. Thanks for the extremely tidy PR 😀

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.

5 participants