diff --git a/lib/nitroux/utils.ex b/lib/nitroux/utils.ex
index fcaad2c..605666b 100644
--- a/lib/nitroux/utils.ex
+++ b/lib/nitroux/utils.ex
@@ -1,19 +1,17 @@
defmodule Nitroux.Utils do
@type tag :: String.t()
- @spec tag(any, Nitroux.Types.GlobalAttributes.t() | [tag] | tag, any) :: tag()
+ @spec tag(any, Nitroux.Types.GlobalAttributes.t() | [tag] | tag, boolean()) :: tag()
@doc """
- Generates dynamic open and closing tags around content
- iex> Nitroux.Utils.tag("div", ["hello", " ", "world"])
- "
hello world
"
+ Generates dynamic open and closing tags around content
+ iex> Nitroux.Utils.tag("div", [])
+ ""
- Nitroux.Utils.tag("div", [])
- ""
+ iex> Nitroux.Utils.tag("div", ["hello world"])
+ "hello world
"
- Nitroux.Utils.tag("div", [html: "hello world"])
- "hello world
"
+ iex> Nitroux.Utils.tag("div", ["hello", " ", "world"])
+ "hello world
"
- Nitroux.Utils.tag("div", [class: "test", html: "hello world"])
- "hello world
"
"""
def tag(name, attrs, container \\ true)
def tag(name, attrs, false), do: "<#{name}#{add_attributes(attrs)}/>"
@@ -23,7 +21,6 @@ defmodule Nitroux.Utils do
do: "<#{name}#{add_attributes(keywordlist)}>#{Keyword.get(keywordlist, :html, "")}#{name}>"
def tag(name, [_h | _t] = list, _container), do: name |> tag(html: Enum.join(list))
-
def tag(name, text, _) when is_binary(text), do: "<#{name}>#{text}#{name}>"
defp add_attributes(attrs) do