html2slim icon indicating copy to clipboard operation
html2slim copied to clipboard

Invalid output when converting helper call with multi-line args and block

Open jonathanhefner opened this issue 8 years ago • 1 comments

When converting passwords/edit.html.erb of the Clearance gem, the following snippet...

<%= form_for :password_reset,
      url: user_password_path(@user, token: @user.confirmation_token),
      html: { method: :put } do |form| %>
  <div class="password-field">
    <%= form.label :password %>
    <%= form.password_field :password %>
  </div>

  <div class="submit-field">
    <%= form.submit %>
  </div>
<% end %>

...Is converted to:

= form_for :password_reset,
-         url: user_password_path(@user, token: @user.confirmation_token),
-         html: { method: :put } do |form|
.password-field
  = form.label :password
  = form.password_field :password
.submit-field
  = form.submit

Note the incorrect field indentation, in addition to the incorrect argument formatting. Perhaps it is the same underlying issue though? (i.e. if the multi-line arguments were correctly recognized and formatted, then the block would be too?)

jonathanhefner avatar Dec 06 '17 19:12 jonathanhefner

Sorry for the delay. Will try soon.

joaomilho avatar Jan 01 '18 21:01 joaomilho