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