js-beautify icon indicating copy to clipboard operation
js-beautify copied to clipboard

Allow option to add a new line before each comment

Open glewe opened this issue 1 year ago • 6 comments

Description

As I can see from other issues and requests here, the requirements for adding/removing line breaks before/after HTML comments are quite versatile. I for example, I wish there would be an option/switch to add "new line before comment" that also honors indentation.

Input

With this new feature, when I give like this input:

<!--begin::Card--><div class="card"><!--begin::Card Header--><div class="card-header">Header</div><!--end::Card Header--><!--begin::Card Body--><div class="card-body">...</div><!--end::Card Header--></div><!--end::Card-->

Expected Output

I'd like to see this output:

<!--begin::Card-->
<div class="card">
  <!--begin::Card Header-->
  <div class="card-header">
    Header
  </div>
  <!--end::Card Header-->
  <!--begin::Card Body-->
  <div class="card-body">
    ...
  </div>
  <!--end::Card Body-->
</div>
<!--end::Card-->

Environment

OS: Win

glewe avatar Sep 28 '23 16:09 glewe