Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect output </eext8><br/> #97

Open
bbugh opened this issue Feb 13, 2022 · 1 comment
Open

Incorrect output </eext8><br/> #97

bbugh opened this issue Feb 13, 2022 · 1 comment

Comments

@bbugh
Copy link

bbugh commented Feb 13, 2022

This is from a new Rails 7 + devise + simple_form. Running prettier-plugin-erb produces the following output:

diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb
index bcebb40..22c7d25 100644
--- a/app/views/devise/registrations/new.html.erb
+++ b/app/views/devise/registrations/new.html.erb
@@ -11,8 +11,8 @@
     <div class="field">
       <%= f.label :password %>
       <% if @minimum_password_length %>
-        <em>(<%= @minimum_password_length %> characters minimum)</em>
-      <% end %><br />
+        <em>(<%= @minimum_password_length %> characters minimum)</em> </eext8
+      ><br />
       <%= f.password_field :password, autocomplete: "new-password" %>
     </div>

Running it again correctly complains and results in error code 2.

app/views/devise/registrations/new.html.erb
[error] app/views/devise/registrations/new.html.erb: Missing closing expression
Source code that breaks
<h2>Sign up</h2>

<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
  <%= render "devise/shared/error_messages", resource: resource %>

  <%= f.input :email, autofocus: true, as: :email %>
  <%= f.input :password, as: :password %>
  <%= f.input :password_confirmation, as: :password %>

  <% if false %>
    <div class="field">
      <%= f.label :password %>
      <% if @minimum_password_length %>
        <em>(<%= @minimum_password_length %> characters minimum)</em>
      <% end %><br />
      <%= f.password_field :password, autocomplete: "new-password" %>
    </div>

    <div class="field">
      <%= f.label :password_confirmation %><br />
      <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
    </div>
  <% end %>

  <div class="actions">
    <%= f.button :submit %>
  </div>
<% end %>

<%= render "devise/shared/links" %>
@bbugh bbugh changed the title Incorrect ooutput </eext8><br/> Incorrect output </eext8><br/> Feb 13, 2022
@Juice10
Copy link

Juice10 commented Oct 4, 2022

Currently prettier 2.3 and above isn't supported yet which is causing this issue. See #49 and linked issues for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants