nebulab / erb-formatter

Format ERB files with speed and precision
MIT License
135 stars 22 forks source link

Formatter has become unhappy with ternary yields #60

Open elliotcm opened 1 month ago

elliotcm commented 1 month ago

Hello!

Similar to the other yield issue that was fixed in 0.7.3, it seems that the formatter is not happy with this in a layout:

<div id="main" class="h-full"><%= content_for?(:content) ? yield(:content) : yield %></div>

It's still unhappy even if the ERB part is moved to its own line, but works OK when turned into a full if-else statement, so that's an OK workaround for us for now.