atom beautifier html comments

392 views Asked by At

I am using atom to write html and atom beautify to format the code. It works quite good but there is one problem that makes my code a little bit messy. Here is the code the way i want it to be:

<section id="hero">
  <div class="container">
    <div class="row">
      <div class="col-sm-8">

        <p>Hello world!</p>

      </div><!--/col-->
    </div><!--/row-->
  </div><!--/container-->
</section><!--/hero-->

And here is the code they way atom beautify makes it:

<section id="hero">
  <div class="container">
    <div class="row">
      <div class="col-sm-8">

        <p>Hello world!</p>

      </div>
      <!--/col-->
    </div>
    <!--/row-->
  </div>
  <!--/container-->
</section>
<!--/hero-->

As you can see, it puts the html comment in a new line and then i have unnecessary lines in my code and also its not so easy to see the closing tag instantly. Is there any way to configure the beautifier?

1

There are 1 answers

0
Holland Wilson On

I don't see a solution. The atom-beautify package allows you to configure it in a variety of ways. One of those is adding tags to be excluded from formatting. However, when I test it by adding "!--/col--" to the array, what I get is the whole back end of the snippet being unformatted.

<section id="hero">
    <div class="container">
        <div class="row">
            <div class="col-sm-8">

                <p>Hello world!</p>

            </div>
            <!--/col-->
    </div><!--/row-->
  </div><!--/container-->
</section><!--/hero-->