1
0

Make funny out-of-bounds images configurable

This commit is contained in:
Mint
2022-11-26 22:17:11 +03:00
parent d064206b40
commit 446f07aa80
2 changed files with 18 additions and 7 deletions
+1
View File
@@ -297,6 +297,7 @@ config :pleroma, :markup,
allow_headings: false,
allow_tables: false,
allow_fonts: false,
allow_custom_classes: false,
scrub_policy: [
Pleroma.HTML.Scrubber.Default,
Pleroma.HTML.Transform.MediaProxy
+17 -7
View File
@@ -76,14 +76,24 @@ defmodule Pleroma.HTML.Scrubber.Default 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_this_attribute_values(:img, ["class"], ["emoji"])
if Pleroma.Config.get([:markup, :allow_custom_classes]) do
Meta.allow_tag_with_this_attribute_values(:img, ["class"], ["emoji"])
Meta.allow_tag_with_these_attributes(:img, [
"width",
"height",
"title",
"alt"
])
Meta.allow_tag_with_these_attributes(:img, [
"width",
"height",
"title",
"alt"
])
else
Meta.allow_tag_with_these_attributes(:img, [
"width",
"height",
"class",
"title",
"alt"
])
end
end
if Pleroma.Config.get([:markup, :allow_tables]) do