aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-09-09 23:29:00 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-09-10 00:13:57 +0000
commit255f46d7ab124d86a71e994deffca5f4f438b49b (patch)
tree590fa385f04993be72df0185403fa96163b6b71a /lib
parent3f64ba5fc8f29efeadf7a072cf8339c778b3fd2d (diff)
downloadpleroma-255f46d7ab124d86a71e994deffca5f4f438b49b.tar.gz
html: new module providing a configurable markup scrubbing policy
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/html.ex14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex
new file mode 100644
index 000000000..0ec73a91d
--- /dev/null
+++ b/lib/pleroma/html.ex
@@ -0,0 +1,14 @@
+defmodule Pleroma.HTML do
+ alias HtmlSanitizeEx.Scrubber
+
+ @markup Application.get_env(:pleroma, :markup)
+
+ def filter_tags(html) do
+ scrubber = Keyword.get(@markup, :scrub_policy)
+ html |> Scrubber.scrub(scrubber)
+ end
+
+ def strip_tags(html) do
+ html |> Scrubber.scrub(Scrubber.StripTags)
+ end
+end