1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.HTML.Scrubber.LinksOnly do
7 An HTML scrubbing policy which limits to links only.
10 @valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], [])
12 require FastSanitize.Sanitizer.Meta
13 alias FastSanitize.Sanitizer.Meta
18 Meta.allow_tag_with_uri_attributes(:a, ["href"], @valid_schemes)
20 Meta.allow_tag_with_this_attribute_values(:a, "rel", [
29 Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
30 Meta.strip_everything_not_covered()