Skip to content

Formatter doesn't support trailing conditionals #65

@Manfred

Description

@Manfred

When you write something like this:

<section>
  <%= tag.div do %>
  <% end if empty? %>
</section>

You will get the following error:

==> FORMATTED:
<section>
  <%= tag.div do %>
    <% end if empty? %>
==> STACK:
[["section", "<section>"], ["%erb%", "tag.div do"], ["%erb%", "end if empty?"]]

==> ERROR: Unmatched close tag, tried with ["section", "</section>"], but ["%erb%", "end if empty?"] was on the stack

Granted, it's not necessarily the prettiest code, but it's valid in ERB so it could be interesting to support.

ERB::Formatter: 0.7.3
Ruby: 3.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions