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.SearchIndexing do
7 An HTML scrubbing policy that scrubs things for searching.
10 require FastSanitize.Sanitizer.Meta
11 alias FastSanitize.Sanitizer.Meta
13 # Explicitly remove mentions
14 def scrub({:a, attrs, children}) do
15 if(Enum.any?(attrs, fn {att, val} -> att == "class" and String.contains?(val, "mention") end),
17 # Strip the tag itself, leave only children (text, presumably)
23 Meta.strip_everything_not_covered()