+ Meta.strip_everything_not_covered()
+end
+
+defmodule Pleroma.HTML.Scrubber.Default do
+ @doc "The default HTML scrubbing policy: no "
+
+ require HtmlSanitizeEx.Scrubber.Meta
+ alias HtmlSanitizeEx.Scrubber.Meta
+
+ @markup Application.get_env(:pleroma, :markup)
+ @uri_schemes Application.get_env(:pleroma, :uri_schemes, [])
+ @valid_schemes Keyword.get(@uri_schemes, :valid_schemes, [])
+
+ Meta.remove_cdata_sections_before_scrub()
+ Meta.strip_comments()
+
+ Meta.allow_tag_with_uri_attributes("a", ["href", "data-user", "data-tag"], @valid_schemes)
+ Meta.allow_tag_with_these_attributes("a", ["name", "title"])
+
+ Meta.allow_tag_with_these_attributes("abbr", ["title"])
+
+ Meta.allow_tag_with_these_attributes("b", [])
+ Meta.allow_tag_with_these_attributes("blockquote", [])
+ Meta.allow_tag_with_these_attributes("br", [])
+ Meta.allow_tag_with_these_attributes("code", [])
+ Meta.allow_tag_with_these_attributes("del", [])
+ Meta.allow_tag_with_these_attributes("em", [])
+ Meta.allow_tag_with_these_attributes("i", [])
+ Meta.allow_tag_with_these_attributes("li", [])
+ Meta.allow_tag_with_these_attributes("ol", [])
+ Meta.allow_tag_with_these_attributes("p", [])
+ Meta.allow_tag_with_these_attributes("pre", [])
+ Meta.allow_tag_with_these_attributes("span", [])
+ Meta.allow_tag_with_these_attributes("strong", [])
+ Meta.allow_tag_with_these_attributes("u", [])
+ Meta.allow_tag_with_these_attributes("ul", [])
+
+ @allow_inline_images Keyword.get(@markup, :allow_inline_images)
+
+ if @allow_inline_images do
+ # restrict img tags to http/https only, because of MediaProxy.
+ Meta.allow_tag_with_uri_attributes("img", ["src"], ["http", "https"])
+
+ Meta.allow_tag_with_these_attributes("img", [
+ "width",
+ "height",
+ "title",
+ "alt"
+ ])