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

Breaks Irregular CSS content #155

Closed
paynecodes opened this issue Oct 25, 2013 · 6 comments
Closed

Breaks Irregular CSS content #155

paynecodes opened this issue Oct 25, 2013 · 6 comments
Assignees
Milestone

Comments

@paynecodes
Copy link

I have documented the issue here.

This seems to be the problem area, but my regex chops are no where near capable of fixing it, unfortunately.

@ghost ghost assigned GoalSmashers Oct 25, 2013
@GoalSmashers
Copy link
Contributor

It actually should not even get to this point since we escape all strings to prevent such situations. Here it doesn't work so consider your challenge accepted!

@paynecodes
Copy link
Author

@GoalSmashers Thanks!

Here is a correction:

Before clean-css

  body::before {
    content: '{ "current" : "small", "all" : ["small"], "position" : 0 }';
    display: none;
  }

Notice, the quotes (") in ["small"] should be safe, but don't seem to be.

GoalSmashers pushed a commit that referenced this issue Oct 26, 2013
* ["content"] is an invalid CSS but it was matched as an attribute.
* If placed inside content property value it was matched BEFORE we escape all free text.
@GoalSmashers
Copy link
Contributor

@jpdesigndev - you identified the place correctly as we actually strip quotation from CSS attributes BEFORE escaping all text. And ["small"] was matched as an attribute but it shouldn't be (cause it's an invalid CSS).

It is fixed now and 1.1.6 is out. Thanks for bringing it into our attention! 

@paynecodes
Copy link
Author

@GoalSmashers Thank you! Your awesome. I haven't been able to test on my end yet, because I can't figure out how to update a dependencie's dependency as documented here.

@paynecodes
Copy link
Author

@GoalSmashers Got it. I had to remove the modules in my node_modules folder, and reinstall them with npm install. I'm thinking it's because of this https://github.com/isaacs/npm/issues/1341.

@GoalSmashers
Copy link
Contributor

Glad you got it. 👍 Seems like that's the problem with npm install.

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