Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

28 řádky
623B

  1. defmodule Pleroma.HTML.Scrubber.LinksOnly do
  2. @moduledoc """
  3. An HTML scrubbing policy which limits to links only.
  4. """
  5. @valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], [])
  6. require FastSanitize.Sanitizer.Meta
  7. alias FastSanitize.Sanitizer.Meta
  8. Meta.strip_comments()
  9. # links
  10. Meta.allow_tag_with_uri_attributes(:a, ["href"], @valid_schemes)
  11. Meta.allow_tag_with_this_attribute_values(:a, "rel", [
  12. "tag",
  13. "nofollow",
  14. "noopener",
  15. "noreferrer",
  16. "me",
  17. "ugc"
  18. ])
  19. Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
  20. Meta.strip_everything_not_covered()
  21. end