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 tags are indented wrongly when attributes are present #1462

Closed
astronomersiva opened this issue Jul 30, 2018 · 4 comments
Closed

HTML tags are indented wrongly when attributes are present #1462

astronomersiva opened this issue Jul 30, 2018 · 4 comments

Comments

@astronomersiva
Copy link

Input

The code looked like this before beautification:

<div class="hello">
<p>hello</p>
</div>

Expected Output

The code should have looked like this after beautification:

<div class="hello">
    <p>hello</p>
</div>

Actual Output

The code actually looked like this after beautification:

<div
  class="hello">
  <p>hello</p>
  </div>
@bitwiseman
Copy link
Member

@astronomersiva
What settings are you using?

@astronomersiva
Copy link
Author

I'm running this with the CLI as

js-beautify -r -s=2 --wrap_line_length=2 --type=html fileName

The same issue is applicable for handlebars as well(with and without the --indent_handlebars flag).

<div
  class="hello">
  {{world}}
  </div>

@bitwiseman
Copy link
Member

Which version of js-beautify? This looks to be fixed in the latest RC (npm install -g js-beautify@next).

@astronomersiva
Copy link
Author

@bitwiseman , thanks a ton for the quick response. Yes, this is fixed in the latest release. Thanks for the great work :)

@bitwiseman bitwiseman added this to the 1.8.0-rc3 milestone Aug 1, 2018
@bitwiseman bitwiseman modified the milestones: 1.8.0-rc4, 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