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

Preserve space between selector and > combinator #1044

Closed
smonff opened this issue Oct 12, 2016 · 6 comments
Closed

Preserve space between selector and > combinator #1044

smonff opened this issue Oct 12, 2016 · 6 comments

Comments

@smonff
Copy link

smonff commented Oct 12, 2016

When beautifying a CSS rule containing a > combinator, the combinator got stuck to the previous selector. Actually, even if it already formatted correctly, the space is removed. It makes quite difficult to use js-beautify in CSS files containing > combinators because it will produce selectors that won't work.

Input

The code looked like this before beautification:

.foo > h3 {
    ...
}

Expected Output

I would expect the input to not change. The code should have looked like this after beautification:

/* Space here
    V */
.foo > h3 {
    ...
}

Actual Output

The code actually looked like this after beautification:

/* No space 
   V */
.foo> h3 {
    ...
}

Environment

OS: Archlinux with Emacs web-beautify.el

Also tested under command line only outside of Emacs.

Settings

Defaults

@smonff
Copy link
Author

smonff commented Oct 26, 2016

It has been fixed in 1.6.4, it don't happen anymore since I set space_around_combinator to true, my bad. This param should be true by default though.

@subfighter3
Copy link

Hello! I still have a "no space" around any sibiling selector when I beautify a css file.
I actually use atom-beautify.

@NSExceptional
Copy link

Me too

@bitwiseman
Copy link
Member

@NSExceptional @subfighter3

https://beautifier.io/ with setting:

{
"space_around_combinator": true
}

Formats as expected. Fix will be needed in atom beautifier.

@NSExceptional
Copy link

Thanks!

@subfighter3
Copy link

Thank you!

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