1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-25 01:12:30 +00:00
mobilizon/lib/service/formatter/html.ex

19 lines
602 B
Elixir
Raw Normal View History

2020-01-22 01:14:42 +00:00
# Portions of this file are derived from Pleroma:
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: AGPL-3.0-only
# Upstream: https://git.pleroma.social/pleroma/pleroma/blob/develop/lib/pleroma/html.ex
defmodule Mobilizon.Service.Formatter.HTML do
@moduledoc """
Service to filter tags out of HTML content.
"""
alias FastSanitize.Sanitizer
2020-01-22 01:14:42 +00:00
alias Mobilizon.Service.Formatter.{DefaultScrubbler, OEmbed}
2020-01-22 01:14:42 +00:00
def filter_tags(html), do: Sanitizer.scrub(html, DefaultScrubbler)
def filter_tags_for_oembed(html), do: Sanitizer.scrub(html, OEmbed)
2020-01-22 01:14:42 +00:00
end