Commit 8ae9424e authored by kaniini's avatar kaniini
Browse files

html: default to using normal scrub policy if provided scrub policy is nil

parent 4cb63318
...@@ -12,17 +12,19 @@ def get_scrubbers() do ...@@ -12,17 +12,19 @@ def get_scrubbers() do
|> get_scrubbers |> get_scrubbers
end end
def filter_tags(html, scrubber) do def filter_tags(html, nil) do
html |> Scrubber.scrub(scrubber)
end
def filter_tags(html) do
get_scrubbers() get_scrubbers()
|> Enum.reduce(html, fn scrubber, html -> |> Enum.reduce(html, fn scrubber, html ->
filter_tags(html, scrubber) filter_tags(html, scrubber)
end) end)
end end
def filter_tags(html, scrubber) do
html |> Scrubber.scrub(scrubber)
end
def filter_tags(html), do: filter_tags(html, nil)
def strip_tags(html) do def strip_tags(html) do
html |> Scrubber.scrub(Scrubber.StripTags) html |> Scrubber.scrub(Scrubber.StripTags)
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment