Skip to content

Conversation

@marcoroth
Copy link
Owner

Previously, inline elements containing ERB control flow could exceed the configured maxLineLength due to:

  1. A hardcoded 120-character limit that bypassed maxLineLength setting
  2. No detection of whether child elements could be rendered inline

This pull request fixes these issues and adds recursive inline detection.

Input

<div>
  <span>
    <% [10, 20, 30, 50, 100].each do |per| %>
      <%= link_to_unless per_page == per, per.to_s, params.merge({ action:, page: 1, per:, remote: }) %>
    <% end %>
  </span>
</div>

Before

<div><span><% [10, 20, 30, 50, 100].each do |per| %><%= link_to_unless per_page == per, per.to_s, params.merge({ action:, page: 1, per:, remote: }) %><% end %></span></div>

After

<div>
  <span>
    <% [10, 20, 30, 50, 100].each do |per| %>
      <%= link_to_unless per_page == per, per.to_s, params.merge({ action:, page: 1, per:, remote: }) %>
    <% end %>
  </span>
</div>

Resolves #882

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 16, 2025

npx https://pkg.pr.new/@herb-tools/formatter@889
npx https://pkg.pr.new/@herb-tools/language-server@889
npx https://pkg.pr.new/@herb-tools/linter@889

commit: 6a5b749

@marcoroth marcoroth merged commit 47f7acc into main Nov 16, 2025
18 checks passed
@marcoroth marcoroth deleted the formatter-inline-formatting branch November 16, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants