Commit 7faa60e9 authored by kaniini's avatar kaniini

add support for comments

parent f3802cfb
......@@ -21,11 +21,15 @@ defmodule FastSanitize.Fragment do
"<#{tag} #{attr_chunks}>"
end
defp fragment_to_html(text) when is_binary(text), do: text
# empty tuple - fragment was clobbered, return nothing
defp fragment_to_html({}), do: ""
# text node
defp fragment_to_html(text) when is_binary(text), do: text
# comment node
defp fragment_to_html({:comment, text}), do: "<!-- #{text} -->"
# tags like <link> - useful attributes, no terminator
defp fragment_to_html({"link", attrs, _}), do: build_start_tag("link", attrs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment