projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4cb6331
)
html: default to using normal scrub policy if provided scrub policy is nil
author
William Pitcock
<nenolod@dereferenced.org>
Sat, 22 Sep 2018 01:10:53 +0000
(
01:10
+0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Sat, 22 Sep 2018 02:52:59 +0000
(
02:52
+0000)
lib/pleroma/html.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/html.ex
b/lib/pleroma/html.ex
index ab62dd1da27062356648a1bd99bdb7962ef8dd9d..878fac28c00a60a91f1edd01cd2aa3b0814ea670 100644
(file)
--- a/
lib/pleroma/html.ex
+++ b/
lib/pleroma/html.ex
@@
-12,17
+12,19
@@
defmodule Pleroma.HTML 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