pmueller
pmueller

Reputation: 143

HTML closing tag with same align as open tag in Intellij

It try to configure the code style of html in IntelliJ. Is it possible to configure it, that the closing tag has the same "alignment" as the open tag?

Here is my example Code:

<div>
    <p>Test</p></div>

If i auto format the code (ctr+alt+L) the code should be format like this:

<div>
    <p>Test</p>
</div>

Edit: The answer from lena is correct it works for the p tag, but i also have a problem with the p-button from primeNG.

<p-button [label]="myLabel"
      (onClick)="clickMethod"
      [disabled]="this.shouldDisabled"></p-button>

should format like this:

<p-button [label]="myLabel"
      (onClick)="clickMethod"
      [disabled]="this.shouldDisabled">
</p-button>

Upvotes: 0

Views: 294

Answers (2)

lena
lena

Reputation: 93748

In Settings | Editor | Code Style | HTML, Other, try removing p from Don't break if inline content list, then re-format the code with Ctr+Alt+L

Upvotes: 1

Alwani Anis
Alwani Anis

Reputation: 258

add prettier extension this is the link https://plugins.jetbrains.com/plugin/10456-prettier

Upvotes: 0

Related Questions