100phlecs / tailwind_formatter

Sorts tailwind classes within elixir projects
https://hexdocs.pm/tailwind_formatter
MIT License
111 stars 11 forks source link

Rewriting variable to string #25

Closed rmand97 closed 1 year ago

rmand97 commented 1 year ago
~H"""
    <div class="flex flex-row gap-3 justify-center items-center text-lg">
      <CP.tooltip :for={{route, icon, text, _} <- @menu_items}>
        <a class="text-gray-500" href={route}>
          <i class={icon}></i>
        </a>
        <:hover_content>
          <%= text %>
        </:hover_content>
      </CP.tooltip>
    </div>
    """

is formatted into

 ~H"""
    <div class="flex flex-row items-center justify-center gap-3 text-lg">
      <CP.tooltip :for={{route, icon, text, _} <- @menu_items}>
        <a class="text-gray-500" href={route}>
          <i class={"icon"}></i>
        </a>
        <:hover_content>
          <%= text %>
        </:hover_content>
      </CP.tooltip>
    </div>
    """

You can see the icon variable of the < i > tag is converted into a string.

100phlecs commented 1 year ago

Published a new release (v0.3.5) with your code as a test case.

Let me know if any other errors crop up 👍