Skip to content

Auto indent not indenting scopes in html.eex files #65

@kuon

Description

@kuon

For example, the following code is the result of auto indent with the plugin:

<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
  <p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>

<div class="form-group">
  <%= label f, :name, class: "control-label" %>
  <%= text_input f, :name, class: "form-control" %>
  <%= error_tag f, :name %>
</div>

<div class="form-group">
  <%= submit "Submit", class: "btn btn-primary" %>
</div>
<% end %>

but it should be formatted like so:

<%= form_for @changeset, @action, fn f -> %>
  <%= if @changeset.action do %>
    <div class="alert alert-danger">
      <p>Oops, something went wrong! Please check the errors below.</p>
    </div>
  <% end %>

  <div class="form-group">
    <%= label f, :name, class: "control-label" %>
    <%= text_input f, :name, class: "form-control" %>
    <%= error_tag f, :name %>
  </div>

  <div class="form-group">
    <%= submit "Submit", class: "btn btn-primary" %>
  </div>
<% end %>

<%= .... %> with a corresponding <% end %> should be indented.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions