Implement Phoenix.HTML.Safe for Funnel schema

pull/3023/head
Adam Rutkowski 3 years ago
parent 9984448bd9
commit 18a023dc3e

@ -90,7 +90,6 @@ defimpl Jason.Encoder, for: Plausible.Goal do
end
end
# TODO: consider Phoenix.HTML.Safe
defimpl String.Chars, for: Plausible.Goal do
def to_string(%{page_path: page_path}) when is_binary(page_path) do
"Visit " <> page_path
@ -100,3 +99,9 @@ defimpl String.Chars, for: Plausible.Goal do
name
end
end
defimpl Phoenix.HTML.Safe, for: Plausible.Goal do
def to_iodata(data) do
data |> to_string() |> Phoenix.HTML.Engine.html_escape()
end
end

Loading…
Cancel
Save