I'm developing "Free marker" (.ftl) in Magnolia CMS and I want them to "Reformat and Indent" correctly (using IntelliJ). I'm working on existing project with a very bad indented files and I'm not able to "clean" the code.
I already tried using the standard functionality "Reformat Code" and "Auto-Indent Lines", but the output is still very bad.
The following code is what I have and what I get:
<div class="[#if condition]class1[/#if]" id="my-id" [#if condition]data-test="true"[/#if]>
<div>
<div>
<section class="">
<div>
<div>
<div>
[#if someCondition][
<span>Lorem Ipsum</span>
[/#if]
</div>
<div>
<span>Lorem Ipsum</span>
</div>
</div>
</div>
</section>
<div id="container">
</div>
</div>
</div>
</div>
<script defer src="/something/source.js"></script>
The following code is what I expected to have:
<div class="[#if condition]class1[/#if]" id="my-id" [#if condition]data-test="true"[/#if]>
<div>
<div>
<section class="">
<div>
<div>
<div>
[#if someCondition][
<span>Lorem Ipsum</span>
[/#if]
</div>
<div>
<span>Lorem Ipsum</span>
</div>
</div>
</div>
</section>
<div id="container">
</div>
</div>
</div>
</div>
<script defer src="/something/source.js"></script>