redhat-developer / intellij-quarkus

IntelliJ Quarkus Tools
Eclipse Public License 2.0
114 stars 44 forks source link

Formatting is broken when using simple `{}` #1345

Closed ia3andy closed 13 hours ago

ia3andy commented 5 days ago

as an example try https://github.com/quarkusio/quarkus-web-lab/tree/main/solution/1-cms

Open src/main/resources/templates/Cms/index.html and reformat. Remove the {} and it works:

https://github.com/redhat-developer/intellij-quarkus/assets/2223984/dd2312e0-b591-4719-b586-3bcb6b7946ec

fbricon commented 5 days ago

Can you reduce the example to the simplest qute template?

ia3andy commented 5 days ago

I won't have the time @fbricon sorry

angelozerr commented 3 days ago

I have no idea how IJ HTML formatter is working, but here a small sample:

<div class="left-bar d-flex justify-content-between">
    <div id="blog-editor" class="flex-grow-1 p-2">
        {#if currentBlogEntry}
                <form action="abc">
                </form>
        {/if}
    </div>
</div>

after formatting:

<div class="left-bar d-flex justify-content-between">
<div id="blog-editor" class="flex-grow-1 p-2">
{#if currentBlogEntry}
    <form action="abc">
    </form>
{/if}
</div>
</div>
angelozerr commented 3 days ago

Here a version without HTML attribute and qute expression:

<div>
    <div>
        {#if}
            <form>
            </form>
        {/if}
    </div>
</div>

after formatting:

<div>
<div>
    {#if}
        <form>
        </form>
    {/if}
    </div>
    </div>