CSS comments always put on new line.
See original GitHub issueBroken again in latest:
>npm install js-beautify
+ js-beautify@1.10.0
added 28 packages from 21 contributors and audited 125 packages in 1.954s
found 0 vulnerabilities
>echo h1{color:red;/*comment*/} > test.css
>js-beautify -f test.css
h1 {
color: red;
/*comment*/
}
>type .jsbeautifyrc
{
"brace_style": "collapse,preserve-inline",
"break_chained_methods": false,
"eval_code": false,
"extra_liners": [],
"indent_char": " ",
"indent_level": 0,
"indent_size": 2,
"indent_with_tabs": false,
"jslint_happy": true,
"keep_array_indentation": false,
"keep_function_indentation": false,
"max_preserve_newlines": 3,
"newline_between_rules": false,
"preserve_newlines": true,
"space_before_conditional": true,
"unescape_strings": false,
"wrap_line_length": 0
}
css.replace(/;\n\s*\/\*/gs, '; /*')
should fix that.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to line-break from css, without using <br />?
Consider a list of <a> links on a vertical menu where you want them all on their own line, but can't use <br>...
Read more >Comments in CSS - CSS-Tricks
Everything enclosed between /* and */ is treated as a comment regardless of how many lines they span, so any other apparent “syntax”...
Read more >How to Add Comments in CSS for Yourself or Your Developer
To comment in CSS, simply place your plain text inside /* */ marks. This tells the browser that they are notes and should...
Read more >CSS Comments - W3Schools
Comments are used to explain the code, and may help when you edit the source code at a later date. Comments are ignored...
Read more >How To Prevent Line Breaks Using CSS - DigitalOcean
In this tutorial prevent line breaks using CSS's white-space property. You will achieve this using three different configurations.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks! This has been the expected behavior at least back to 1.7.5, so not a break.
However keeping single line comments on the same line is a reasonable enhancement.
still happening… It would be very helpful to have comments in-line