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

Braces inside comments inside values fail to parse #39

Open
suskin opened this issue Feb 11, 2015 · 0 comments
Open

Braces inside comments inside values fail to parse #39

suskin opened this issue Feb 11, 2015 · 0 comments

Comments

@suskin
Copy link

suskin commented Feb 11, 2015

Hey guys!

This is related to reworkcss/css#24 .

I have some library css files which I'm bundling, and they have comments with braces inside of the values of some properties. Here's an example:

.a {
  background: blue /* This is { blue } */;
}

When I try to atomify this file, I get an error. The one I see with the example above looks like this:

         Error: /Users/danielsuskin/Documents/Code/site/atomify-css/test/fixtures/css/a-with-inline-comment.css:4:1: missing '{'
           at error (/Users/danielsuskin/Documents/Code/site/atomify-css/node_modules/rework/node_modules/css/lib/parse/index.js:64:15)
           at declarations (/Users/danielsuskin/Documents/Code/site/atomify-css/node_modules/rework/node_modules/css/lib/parse/index.js:241:25)
           at rule (/Users/danielsuskin/Documents/Code/site/atomify-css/node_modules/rework/node_modules/css/lib/parse/index.js:554:21)
           at rules (/Users/danielsuskin/Documents/Code/site/atomify-css/node_modules/rework/node_modules/css/lib/parse/index.js:111:70)
           at stylesheet (/Users/danielsuskin/Documents/Code/site/atomify-css/node_modules/rework/node_modules/css/lib/parse/index.js:81:16)
           at module.exports (/Users/danielsuskin/Documents/Code/site/atomify-css/node_modules/rework/node_modules/css/lib/parse/index.js:558:20)
           at rework (/Users/danielsuskin/Documents/Code/site/atomify-css/node_modules/rework/index.js:27:21)
           at applyRework (/Users/danielsuskin/Documents/Code/site/atomify-css/css.js:43:15)
           at /Users/danielsuskin/Documents/Code/site/atomify-css/css.js:36:22
           at Array.forEach (native)

With my library css, I get one more like Error: property missing ':'

Anyway, I was originally planning to fix this by adding the option to pass configuration into rework, so that you could set silent: true, but that just resulted in this output:

.a {
  background: blue /* This is { blue;
}

Which isn't really right. So I figured I'd start by filing an issue. The above is happening for me with the latest atomify-css.

Do you guys have any ideas about the best way to handle css files containing this type of comment?

Thanks!
Daniel

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

1 participant