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

Invalid erb output for long blocks #41

Open
Pezmc opened this issue May 12, 2021 · 2 comments
Open

Invalid erb output for long blocks #41

Pezmc opened this issue May 12, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Pezmc
Copy link

Pezmc commented May 12, 2021

Prettier-plugin-erb currently sometimes split the do from a block onto a new line, causing a syntax error:

ActionView::SyntaxErrorInTemplate - Encountered a syntax error while rendering template

Example input:

<%= link_to signout_path, class: "very-long-class-name-here-to-cause-line-break" do %>
  Welcome
<% end %>

Output:

<%= link_to signout_path, class: "very-long-class-name-here-to-cause-line-break"
do %> Welcome <% end %>

Full error:

ActionView::SyntaxErrorInTemplate - Encountered a syntax error while rendering template: check <%= link_to signout_path, class: "very-long-class-name-here-to-cause-line-break"
do %> Welcome <% end %>:
  app/views/layouts/application.html.erb:70
@adamzapasnik adamzapasnik self-assigned this May 12, 2021
@adamzapasnik adamzapasnik added the bug Something isn't working label May 12, 2021
@adamzapasnik
Copy link
Owner

Hey @Pezmc thanks for submitting the issue, it will be fixed in the next release.

@adamzapasnik
Copy link
Owner

should be fixed in a newly released v0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants