Skip to content

Formatter: Multiline ERB tag continuation lines should be formatted and indented #1344

@cb341

Description

@cb341

Bug Report

Multiline ERB tags lose indentation for continuation lines after the opening tag.

Reproduction

You can reproduce this issue using the following playground link:

https://herb-tools.dev/playground?tab=format#DwZwpgxgLglg9gOwHwCgAEbgBMYDdUYbACkAvGgGYB0MCADgK5RoBcAtgJ4D6CDbARmABOAGnRpajKFwAWUNgBsWaAN7iMWAIZRNytYQOEKMMAqxcocAOZWFYC5qFWwUZQCIIMyAGt+cAB5uYgYAvuIhaMQEmAD0OPgowDHg0PDIQA

Expected Behavior

<section>
  <div>
    <%= f.input :my_number,
                input_html: {
                  data: {
                        field_toggle_target: "checkbox",
                  }
                } %>
  </div>
</section>

Actual Behavior

<section>
  <div>
    <%= f.input :my_number,
  input_html: {
    data: {
          field_toggle_target: "checkbox",
    }
  } %>
  </div>
</section>

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions