Closed rubenstolk closed 8 years ago
Oops, just noticed that there was already an issue for this, #8. Well anyways, I think this is a really good shot at solving that issue...
LGTM
@rubenstolk I know there are no tests yet.... but it would be SO cool if you added a simple unit test for this :)
@samccone I guess I would leave that to @azakus or someone else to set it up, I don't mind writing the test itself but not very sure what framework and all we're looking at...
Seems like @azakus is OK with mocha :coffee:
We won't make you setup tests for the repo in this PR :) I'll let @azakus have the final LGTM and merge b/c I can't update the npm module.
:+1: :+1: just a thought :cloud: obviously not required at all :wink: --- thanks again for this @rubenstolk
Yeah, I've been bad by not adding tests :(. LGTM!
Awesome!
Would you make a 1.2.1
on npm
?
Done!
Cheers and beers on me!
I believe this fix is breaking cases where css selectors contain ::content
preceded by a space. For example, paper-drawer-panel has a selector like this:
iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle]
The new code is removing the space between #main
and ::content
which is significant:
iron-selector:not(.narrow-layout) #main::content [paper-drawer-toggle]
Hmm right! I guess we might want to remove the : from the regex...
Or look for :[^:] patterns, I'll check it out tomorrow.
Sent a new PR #10
Removing all occurrences of 2 spaces is dangerous. For example look at the following definition used in https://github.com/polymerelements/paper-styles:
For indentation reasons the authors have used two spaces between
0
and6px
/8px
. Replacing two spaces or more with nothing would result in06px
/08px
.This pull requests solves this by reducing two or more spaces to one (two or more will always have the same meaning as one) and by removing leading and trailing spaces afterwards.