Skip to content

Conversation

@marcoroth
Copy link
Owner

@marcoroth marcoroth commented Nov 8, 2025

This pull request fixes a bug in the formatter, where we accidentally visited the end_node twice, instead of the subsequent node.

This following document

<span>
  <% if valid? %>
    Valid
  <% else %>
    Invalid
  <% end %>
</span>

was previously formatter to:

<span><% if valid? %>Valid<% end %><% end %></span>

Now it gets correctly formatted as:

<span><% if valid? %>Valid<% else %>Invalid<% end %></span>

Resolves #789

@marcoroth marcoroth added the bug Something isn't working label Nov 8, 2025
@marcoroth marcoroth merged commit 8d9ed54 into main Nov 8, 2025
12 checks passed
@marcoroth marcoroth deleted the foramtter-conditional-inline-mode branch November 8, 2025 18:15
@tk0miya
Copy link

tk0miya commented Nov 9, 2025

Thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working formatter typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatter: herb-format breaks HTML having <span> and if-else block

3 participants