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

Code within Elixir code tags not formatted #55

Open
aidalgol opened this issue Jun 3, 2021 · 0 comments
Open

Code within Elixir code tags not formatted #55

aidalgol opened this issue Jun 3, 2021 · 0 comments

Comments

@aidalgol
Copy link

aidalgol commented Jun 3, 2021

Elixir code within <% %> or <%= %> is not formatted.

Example

Input

<nav class= "navbar">
  <div class ="navbar-group">
      <div   class="navbar-item">
    <div class="buttons" >
        <%= case  something do %>
           <% nil   -> %>
            <%= some_function( "foo", :bar, "boo", "goo", "blah", "bleh", "are we there yet?", "come ooooon!", "how much further?", "I'm borrrred!!") %>
        <% _ -> %>
              <%= boring(:bleh) %>
          <%end %>
      </div>
 </div  >
   </div>
 </nav>

Output

<nav class="navbar">
  <div class="navbar-group">
    <div class="navbar-item">
      <div class="buttons">
        <%= case  something do %>
          <% nil   -> %>
            <%= some_function( "foo", :bar, "boo", "goo", "blah", "bleh", "are we there yet?", "come ooooon!", "how much further?", "I'm borrrred!!") %>
          <% _ -> %>
            <%= boring(:bleh) %>
        <% end %>
      </div>
    </div>
  </div>
</nav>

The tags are correctly formatted, but none of the Elixir code is touched.

We probably don't want to reimplement mix format, so maybe we could pass the code snippets between prettier and the Elixir formatter?

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