Clean up deftag generated macros
This commit is contained in:
parent
85d6b8586f
commit
2727d346b6
2 changed files with 2 additions and 10 deletions
|
@ -115,7 +115,7 @@ defmodule Dsl.Html do
|
||||||
end
|
end
|
||||||
|
|
||||||
quote do
|
quote do
|
||||||
unquote(name)(unquote(attrs), unquote(inner), unquote(outer))
|
unquote(name)(unquote(attrs), unquote(inner))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -123,14 +123,6 @@ defmodule Dsl.Html do
|
||||||
outer = unquote(Macro.escape(block))
|
outer = unquote(Macro.escape(block))
|
||||||
name = unquote(name)
|
name = unquote(name)
|
||||||
|
|
||||||
quote do
|
|
||||||
unquote(name)(unquote(attrs), unquote(inner), unquote(outer))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
defmacro unquote(name)(attrs, inner, outer) do
|
|
||||||
outer = unquote(Macro.escape(block))
|
|
||||||
|
|
||||||
{tag, meta, [old_attrs]} = outer
|
{tag, meta, [old_attrs]} = outer
|
||||||
|
|
||||||
attrs = [
|
attrs = [
|
||||||
|
|
|
@ -166,7 +166,7 @@ defmodule Dsl.HtmlTest do
|
||||||
|
|
||||||
result =
|
result =
|
||||||
htm do
|
htm do
|
||||||
flex class: "justify-between", id: "king"
|
flex(class: "justify-between", id: "king")
|
||||||
end
|
end
|
||||||
|
|
||||||
assert result =~ ~s{class="flex justify-between"}
|
assert result =~ ~s{class="flex justify-between"}
|
||||||
|
|
Reference in a new issue