-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTMLFormatter - text between inline elements (#2010)
An attempt to fix #2008 The core issue with those examples is they get into an "incomplete" state on the first format, causing `mix format --check-formatted` to fail. A couple of examples on master: ``` iex> input = """ ...> <span><%= link("Edit", to: Routes.post_path(@conn, :edit, @post)) %></span> | ...> <span><%= link("Back", to: Routes.post_path(@conn, :index)) %></span> ...> """ iex> IO.puts formatted = Phoenix.LiveView.HTMLFormatter.format(input, []) <span><%= link("Edit", to: Routes.post_path(@conn, :edit, @post)) %></span> | <span><%= link("Back", to: Routes.post_path(@conn, :index)) %></span> iex> IO.puts Phoenix.LiveView.HTMLFormatter.format(formatted, []) <span><%= link("Edit", to: Routes.post_path(@conn, :edit, @post)) %></span> | <span><%= link("Back", to: Routes.post_path(@conn, :index)) %></span> ``` ``` iex> input = """ ...> <span><%= @user_a %></span> X <span><%= @user_b %></span> ...> """ iex> IO.puts formatted = Phoenix.LiveView.HTMLFormatter.format(input, [line_length: 5]) <span> <%= @user_a %> </span> X <span> <%= @user_b %> </span> iex> IO.puts Phoenix.LiveView.HTMLFormatter.format(formatted, [line_length: 5]) <span> <%= @user_a %> </span> X <span> <%= @user_b %> </span> ``` /cc @feliperenan @josevalim
- Loading branch information
Showing
2 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters