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

Support for .html.heex #1964

Open
NatoBoram opened this issue Nov 18, 2021 · 0 comments
Open

Support for .html.heex #1964

NatoBoram opened this issue Nov 18, 2021 · 0 comments

Comments

@NatoBoram
Copy link

NatoBoram commented Nov 18, 2021

Description

Phoenix is a web framework in Elixir which uses some special server-side HTML tags.

Right now, the result is pretty good. I think the only missing thing is adding an indent level when there's a do %> and removing one when there's an <% end %>. These special tags can be opened by either <%= or <%.

There's a large demand for this feature spanning many projects :

Input

With this new feature, when I give like this input:

<%= submit class: "btn btn-outline-primary" do %>
<%= gettext("Create") %>
<% end %>
<%= if @component do %>
<%= for dep <- @component.dependencies() do %>
<.live_component module={dep} id={dep.id()} />
<% end %>
<% end %>

Expected Output

I'd like to see this output:

<%= submit class: "btn btn-outline-primary" do %>
  <%= gettext("Create") %>
<% end %>
<%= if @component do %>
  <%= for dep <- @component.dependencies() do %>
    <.live_component module={dep} id={dep.id()} />
  <% end %>
<% end %>

Environment

OS: Pop!_OS 21.04 x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants