Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter doesn't support trailing conditionals #65

Open
Manfred opened this issue Oct 23, 2024 · 0 comments
Open

Formatter doesn't support trailing conditionals #65

Manfred opened this issue Oct 23, 2024 · 0 comments

Comments

@Manfred
Copy link

Manfred commented Oct 23, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant