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

Unsupported beautification result 'Parsing error #1547

Closed
BMOv2600 opened this issue Mar 8, 2017 · 3 comments
Closed

Unsupported beautification result 'Parsing error #1547

BMOv2600 opened this issue Mar 8, 2017 · 3 comments

Comments

@BMOv2600
Copy link

BMOv2600 commented Mar 8, 2017

Beautify cannot parse some CSS. This error also prevents beautify from beautifying any CSS in the file.

It dislikes the following:

@media(min-width:480px) and (max-width:619px) {
    ul.footer-menu-list li: nth-child(3) {
    margin-right: 0;
}
ul.footer-menu-list li:first-child {
    margin-left: 0;
}
.footer-menu-list-item {
    margin: 20px 16px;
}
}

This is what the code looked like before:

@media(min-width:480px) and (max-width:619px) {
    ul.footer-menu-list li: nth-child(3) {
    margin-right: 0;
}
ul.footer-menu-list li:first-child {
    margin-left: 0;
}
.footer-menu-list-item {
    margin: 20px 16px;
}
}

Expected Output

The beautified code should have looked like this:

@media(min-width:480px) and (max-width:619px) 
	{
    	ul.footer-menu-list li: nth-child(3) 
      {
        margin-right: 0;
      }
    ul.footer-menu-list li:first-child 
      {
        margin-left: 0;
      }
    .footer-menu-list-item 
      {
        margin: 20px 16px;
      }
    }

Actual Output

The beautified code actually looked like this:

@media(min-width:480px) and (max-width:619px) {
    ul.footer-menu-list li: nth-child(3) {
    margin-right: 0;
}
ul.footer-menu-list li:first-child {
    margin-left: 0;
}
.footer-menu-list-item {
    margin: 20px 16px;
}
}

Steps to Reproduce

Error: Unsupported beautification result 'Parsing error: Please check the validity of the block starting from line #1616
1614 | }
1615 | @media(min-width:480px) and (max-width:619px) {
1616*| ul.footer-menu-list li: nth-child(3) {
1617 | margin-right: 0;
1618 | }
Gonzales PE version: 3.0.0-28
Syntax: css'.
at beautifyCompleted (/Users/deauberts/.atom/packages/atom-beautify/src/beautify.coffee:135:21)
at tryCatcher (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:687:18)
at Async._drainQueue (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:143:10)
at Async.drainQueues (/Users/deauberts/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)

Debug

Here is a link to the debug.md Gist:
https://gist.github.com/BMOv2600/acc5abfd3b26ef8a042674ba4b33bd3d

Checklist

I have:

  • [ X] Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [ X] Reloaded (or restarted) Atom to ensure it is not a caching issue
  • [ X] Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • [ X] Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • [ X] Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
@tonyganch
Copy link

Hi guys!
First of all, li: nth-child(3) is not valid css, there should be no space after :, that's why you get parsing error.
Also, Atom Beautify uses outdated version of csscomb package (3.1 instead of 4.0), I would suggest you update to the latest one, it has a lot of parsing issues fixed.

@BMOv2600
Copy link
Author

BMOv2600 commented Mar 9, 2017

Sorry. I used an unminifier that might have added the space. Glad you caught that.

How do I update Beautify's csscomb package? After I fixed this issue, another one sprung up that I assume is d/t the csscomb.

@Glavin001
Copy link
Owner

#1660 has been merged.

Published to v0.29.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants