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

Custom snippet for erb doesn't indent end tag properly #543

Open
coaxial opened this issue Oct 23, 2022 · 0 comments
Open

Custom snippet for erb doesn't indent end tag properly #543

coaxial opened this issue Oct 23, 2022 · 0 comments

Comments

@coaxial
Copy link

coaxial commented Oct 23, 2022

I'm creating a custom snippet for erb tags:

<%= ... %>
  ...
<% end %

~/.snippets_custom.json:

{
  "eruby": {
    "extends": "html",
    "snippets": {
      "erb": "<%= | %>\n\t${child}<% end %>"
    }
  }
}

And when doing div>erb>p, the output is:

<div>
  <%=  %>
    <p></p>
    <% end %>
</div>

Note how the <% end %> is indented one level too much, and doesn't match the json file.

If I add \n after ${child}, so ...${child}\n<% end %>, then the indent is correct but there is obviously an extra, unneeded line before the end tag.

@coaxial coaxial changed the title Custom snippe5 for erb doesn't indent end tag properly Custom snippet for erb doesn't indent end tag properly Oct 23, 2022
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

1 participant