html: default to using normal scrub policy if provided scrub policy is nil
This commit is contained in:
parent
4cb6331843
commit
8ae9424edb
1 changed files with 7 additions and 5 deletions
|
@ -12,17 +12,19 @@ def get_scrubbers() do
|
|||
|> get_scrubbers
|
||||
end
|
||||
|
||||
def filter_tags(html, scrubber) do
|
||||
html |> Scrubber.scrub(scrubber)
|
||||
end
|
||||
|
||||
def filter_tags(html) do
|
||||
def filter_tags(html, nil) do
|
||||
get_scrubbers()
|
||||
|> Enum.reduce(html, fn scrubber, html ->
|
||||
filter_tags(html, scrubber)
|
||||
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
|
||||
html |> Scrubber.scrub(Scrubber.StripTags)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue