Identify custom HTML elements in WebStorm

I use WebStorm 9.0.2 to create HTML templates that use the control flow syntax without a container from Knockout ( Example ) to conditionally display elements.

Here is an example:

<div id="my-page">
  <!-- ko if: myObservable() -->
  <h2>Hello World!</h2>
  <p>It would be nice if things within ko:if are indented..</p>
  <!-- /ko -->
</div>

Is there an option in WebStorm to determine that everything inside an ad <!-- ko if: ... ->should be indented?

+4
source share
2 answers

, Notockout .

, , WebStorm .

, . Formatter Control. File → Settings → Editor → Code Style:

Enable Formatter Control

Formatter , , // . , ( ).

HTML :

<div id="my-page">
  <!-- @formatter:off -->
  <!-- ko if: myObservable() -->
    <h2>Hello World!</h2>
    <p>It would be nice if things within ko:if are indented..</p>
  <!-- /ko -->
  <!-- @formatter:on -->
</div>

WebStorm .

- , , .

0

All Articles