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

Tags with <%- or -%> not handled #1

Open
studious opened this issue Jun 9, 2024 · 2 comments
Open

Tags with <%- or -%> not handled #1

studious opened this issue Jun 9, 2024 · 2 comments

Comments

@studious
Copy link

studious commented Jun 9, 2024

I can successfully run this plugin on some templates but not others

After looking at the source I figured it might be that the trimming notation on tags hasn't been catered for

https://www.puppet.com/docs/puppet/5.5/lang_template_erb#tags

@ippachi
Copy link
Owner

ippachi commented Jun 10, 2024

I can't reproduce. Could you give me not working erb file?

@studious
Copy link
Author

Oh before I forget, your install instruction seems to reference a misspelled version of your npm package. I had to search for it on the npm registry even though your prettierrc snippet listed it correctly.

Onto the parsing issue. Here is the smallest reproducible portion that caused the error I was seeing.

<%- if !!flash[:errors] %>
  <%- flash[:errors].each do |error| %>
    <p style="color: red"><%= error %></p>
  <% end -%>
<% end -%>

You can see two attempts in my screenshot below.

  1. Attempt using the code block as seen above
  2. Attempt after removing the - from the erb start and end tags.
Screenshot 2024-06-11 at 9 18 52 AM

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