Update tidy_raw() to ignore null values
This commit is contained in:
@ -3,10 +3,13 @@ defmodule OutlookWeb.ViewHelpers do
|
||||
import Phoenix.HTML, only: [raw: 1]
|
||||
|
||||
@doc "Just sanitize tags"
|
||||
def tidy_raw(html) do
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user