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
Empty lines are removed in HTML and CSS, and also adds trailing spaces #285
Comments
Using input you provided, the output as of a9f3d1a is almost correct. The only remaining issue is bad indentation at the h1 tag. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
</head>
<body>
<div id="main-toolbar" class="toolbar">
<button class="toolbutton" id="activity-button" title="My Activity"></button>
<!-- Add more buttons here -->
<!-- Buttons with class="pull-right" will be right aligned -->
<button class="toolbutton pull-right" id="stop-button" title="Stop"></button>
</div>
<!-- The content of your activity goes inside the canvas -->
<div id="canvas">
<!-- Replace this message with your own content -->
<h1>Header</h1>
<p>Content text.</p>
</div>
</body>
</html> |
Ah, excellent! Do you want a new issue report or is fine tracking the indent issue here? |
Leave this one, it's cool. |
I actually preferred when empty lines were removed. This is because my development environment uses partials and includes, which add their own new lines. I would like these to be stripped from the beautified HTML. Do you think it would be possible to add an option to strip empty lines? |
Open a new issue for it, we'll look into it. |
OK |
Empty lines are good to organize code and for readability, but they are removed in HTML and CSS.
With HTML I also see that unwanted trailing spaces are added, and sometimes it does bad indentation.
Consider this HTML input processed with: js-beautify --type html --indent-size 2
The output is:
The output has:
I was expecting the output to be the same, as the input is correctly indented.
The text was updated successfully, but these errors were encountered: