rhtml icon indicating copy to clipboard operation
rhtml copied to clipboard

Matching `do` and `end` fails with string or number as last => argument

Open Sammidysam opened this issue 11 years ago • 0 comments

The following code successfully detects and sets the indentation of the second line

<%= test_method :thing => true, :other_thing => false, :third => :fourth do %>
  <% success_method %>
<% end %>

It also succeeds when the value of :third is a variable (e.g. :third => variable).

However, when the value of :third (or any last argument to the method in :key => value notation) is a string or integer, the indentation fails.

<%= test_method :thing => true, :other_thing => false, :third => "ohno" do %>
<% fail_method %>
<% end %>

<%= test_method :thing => true, :other_thing => false, :third => 0 do %>
<% fail_method %>
<% end %>

Sammidysam avatar Dec 25 '13 14:12 Sammidysam