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_newlines always true #449

Closed
shannonmoeller opened this issue Apr 15, 2014 · 1 comment
Closed

preserve_newlines always true #449

shannonmoeller opened this issue Apr 15, 2014 · 1 comment

Comments

@shannonmoeller
Copy link

This line makes preserve_newlines always true:

preserve_newlines = options.preserve_newlines || true;

https://github.com/einars/js-beautify/blob/master/js/lib/beautify-html.js#L109

The default operator is a falsy check, not a undefined or null check, so preserve_newlines can never be set to false as it will default back to true. Should be something like this instead:

preserve_newlines = options.preserve_newlines;
if (options.preserve_newlines == null) {
    preserve_newlines = true;
}
@einars einars closed this as completed in 1293f70 Apr 15, 2014
@shannonmoeller
Copy link
Author

Awesome. Thanks for the quick turnaround!

@bitwiseman bitwiseman added this to the v1.5.0 milestone Apr 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants