diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-09-09 23:40:24 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-09-10 00:14:47 +0000 |
commit | ac486fc59b49d26db7c3b6b61d0affeb34f9b3e0 (patch) | |
tree | 5492c7d6b438b6acbb11d4c8303f9b7ab76b3045 /lib/pleroma/formatter.ex | |
parent | 255f46d7ab124d86a71e994deffca5f4f438b49b (diff) | |
download | pleroma-ac486fc59b49d26db7c3b6b61d0affeb34f9b3e0.tar.gz |
everywhere: use Pleroma.HTML module instead of HtmlSanitizeEx directly
Diffstat (limited to 'lib/pleroma/formatter.ex')
-rw-r--r-- | lib/pleroma/formatter.ex | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 2b4c3c2aa..62f54a3f2 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -1,6 +1,7 @@ defmodule Pleroma.Formatter do alias Pleroma.User alias Pleroma.Web.MediaProxy + alias Pleroma.HTML @tag_regex ~r/\#\w+/u def parse_tags(text, data \\ %{}) do @@ -144,8 +145,8 @@ defmodule Pleroma.Formatter do def emojify(text, emoji) do Enum.reduce(emoji, text, fn {emoji, file}, text -> - emoji = HtmlSanitizeEx.strip_tags(emoji) - file = HtmlSanitizeEx.strip_tags(file) + emoji = HTML.strip_tags(emoji) + file = HTML.strip_tags(file) String.replace( text, @@ -154,7 +155,7 @@ defmodule Pleroma.Formatter do MediaProxy.url(file) }' />" ) - |> HtmlSanitizeEx.basic_html() + |> HTML.filter_tags() end) end |