Add tidy_raw() helper

This commit is contained in:
Thelonius Kort
2023-02-14 20:52:10 +01:00
parent b0267ef752
commit 66a61c8380
6 changed files with 21 additions and 5 deletions

View File

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