diff --git a/lib/cozy_svg.ex b/lib/cozy_svg.ex index e1076c4..c937637 100644 --- a/lib/cozy_svg.ex +++ b/lib/cozy_svg.ex @@ -235,7 +235,7 @@ defmodule CozySVG do end def render(%{} = library, key, attrs) when is_map(attrs) do - attrs = Map.to_list(attrs) + attrs = attrs |> Map.to_list() |> Enum.sort_by(&elem(&1, 0)) render(library, key, attrs) end diff --git a/test/cozy_svg_test.exs b/test/cozy_svg_test.exs index 0f3a69d..fbff410 100644 --- a/test/cozy_svg_test.exs +++ b/test/cozy_svg_test.exs @@ -58,7 +58,7 @@ defmodule CozySVGTest do test "inserts attributes as a map" do svg = CozySVG.render(library(), "x", %{class: "test_class", "@click": "action"}) - assert String.starts_with?(svg, "