Add tidy_raw() helper
This commit is contained in:
12
lib/outlook_web/view_helpers.ex
Normal file
12
lib/outlook_web/view_helpers.ex
Normal 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
|
||||
Reference in New Issue
Block a user