Files
phoenix-ausblick/lib/outlook_web/view_helpers.ex
2023-02-28 21:35:09 +01:00

16 lines
281 B
Elixir

defmodule OutlookWeb.ViewHelpers do
import Phoenix.HTML, only: [raw: 1]
@doc "Just sanitize tags"
def tidy_raw(html) when is_binary(html) do
html
|> Floki.parse_fragment!()
|> Floki.raw_html()
|> raw
end
def tidy_raw(whatever) do
whatever
end
end