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

Option 'max_preserve_newlines' not working on beautify_css.js CSS Beautifier #1863

Closed
bibekoli opened this issue Dec 7, 2020 · 2 comments · Fixed by #1867
Closed

Option 'max_preserve_newlines' not working on beautify_css.js CSS Beautifier #1863

bibekoli opened this issue Dec 7, 2020 · 2 comments · Fixed by #1867

Comments

@bibekoli
Copy link

bibekoli commented Dec 7, 2020

Description

This is the default template for bug reports
The option 'max_preserve_newline' is not working with CSS Beautifier. When the option 'preserve_newlines': true and 'max_preserve_newlines': 2, it is keeping all the newlines instead of 2 only.
NOTE:

  • Do not include screenshots! This library is a text processor, we need text inputs and outputs for debugging and fixing issues.
  • Check the list of open issues before filing a new issue.

Input

The code looked like this before beautification:

p {





color: blue;
}

Expected Output

The code should have looked like this after beautification:

p {

color: blue;
}

Actual Output

The code actually looked like this after beautification:

p {





color: blue;
}

Steps to Reproduce

Use these options:
{
'preserve_newlines': true,
'max_preserve_newlines': 2,
}
It will keep all newlines instead of 2 only.

Environment

OS: Chrome Browser

Settings

Example:

{
    'preserve_newlines': true,
    'max_preserve_newlines': 2,
}
@bitwiseman
Copy link
Member

Thanks for reporting!
Would you be up for submitting a PR?

@JuanFML
Copy link
Contributor

JuanFML commented Dec 21, 2020

Hello! I saw this issue and I would like to work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants