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

html-beautify's max_preserve_newlines preserves one new line too much #517

Closed
raphinesse opened this issue Sep 4, 2014 · 4 comments
Closed
Milestone

Comments

@raphinesse
Copy link

"max_preserve_newlines": 2 will preserve 2 consecutive blank lines (ergo 3 newlines) when beautifying HTML. With JS this behaves like the name would suggest.

Personally I would have preferred max_preserve_blank_lines, but that's just my two cents.

Using the JS-Version of js-beautify.

@bitwiseman
Copy link
Member

Please provide examples of input, expected output, and actual output. Thanks!

@raphinesse
Copy link
Author

Input

<!DOCTYPE HTML>


<p>Welcome to this example.</p>

With "max_preserve_newlines": 2, the output equals the input. As you see it preserves two blank lines lines which equals three newlines.

Expected

<!DOCTYPE HTML>

<p>Welcome to this example.</p>

This is what you get with "max_preserve_newlines": 1

Note: js-beautify (i.e. this tool given a JS file) interprets the term "newline" like I do here.

@bitwiseman bitwiseman added this to the v1.7.6 milestone Jun 30, 2018
@raphinesse
Copy link
Author

Has this been fixed in 1.7.6?

@bitwiseman
Copy link
Member

bitwiseman commented Jun 30, 2018

Will be when 1.7.6 comes out.

@bitwiseman bitwiseman modified the milestones: v1.8.0-rc2, 1.8.0 Aug 22, 2018
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

2 participants