Stillat / blade-parser-typescript

A Laravel Blade parser, compiler, and static analyzer written in TypeScript.
https://stillat.com
MIT License
82 stars 2 forks source link

`a` tag gets indented too far inside a `@if` tag #110

Open RobertBlaauwendraad opened 1 month ago

RobertBlaauwendraad commented 1 month ago

With

[*.blade.php]
indent_size = 2

This correctly indented snippet:

  @if ($hasWhatsappButton)
    <a
      href="{{ get_field('whatsapp_contact_link', 'option') }}"
      target="_blank"
      class="btn--contact bg-whatsapp"
    >
      <i class="icon icon-whatsapp"></i>
    </a>
  @endif

Becomes:

  @if ($hasWhatsappButton)
      <a
        href="{{ get_field('whatsapp_contact_link', 'option') }}"
        target="_blank"
        class="btn--contact bg-whatsapp"
      >
        <i class="icon icon-whatsapp"></i>
      </a>
  @endif
JohnathonKoster commented 1 month ago

I am unable to reproduce with a prettierrc or .format.json.file. Can you provide the configuration files you are using?

Thanks