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

Multiline strings inside blocks keep indenting more (bug) #66

Open
mikker opened this issue Nov 8, 2024 · 3 comments
Open

Multiline strings inside blocks keep indenting more (bug) #66

mikker opened this issue Nov 8, 2024 · 3 comments

Comments

@mikker
Copy link

mikker commented Nov 8, 2024

Consider this example:

<%= component_page do %>
  <%= code_example "
    Text          
  " %>
<% end %>

On each save, Text gets indented another level:

<%= component_page do %>
  <%= code_example "
      Text          
    " %>
<% end %>

<!-- and... -->

<%= component_page do %>
  <%= code_example "
        Text          
      " %>
<% end %>

I'd love to provide a PR but could really use a pointer for where to start.

@enescakir
Copy link

We're experiencing a similar issue. The multiline string continues to indent with each run.

@elia
Copy link
Member

elia commented Feb 4, 2025

Sorry for the delay, @mikker or anyone else willing to give it a crack, the easiest is to look at existing tests and add a failing one.
Inside test/fixtures we have matching files for the initial ERB and the expected result after formatting, adding a couple of files there and running bin/rake should highlight the issue.

@enescakir
Copy link

Hi @elia, here's an example for my case. enescakir@26740db

It increases indentation with every run, so the test fails even after I updated the expected output.

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

3 participants