summaryrefslogtreecommitdiff
path: root/priv/scrubbers/default.ex
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2023-05-09 19:25:39 -0400
committertusooa <tusooa@kazv.moe>2023-05-09 19:27:32 -0400
commit163e82bab1cc12ad323bfc9c1fcada11fa3b223a (patch)
treed637f7bee025563542f937f1c15c4b15aa00d15c /priv/scrubbers/default.ex
parentd97425d49e9bbc62c01e3bc6874b8d1067e46fd6 (diff)
downloadpleroma-163e82bab1cc12ad323bfc9c1fcada11fa3b223a.tar.gz
pleroma-163e82bab1cc12ad323bfc9c1fcada11fa3b223a.zip
Allow lang attribute
Diffstat (limited to 'priv/scrubbers/default.ex')
-rw-r--r--priv/scrubbers/default.ex81
1 files changed, 41 insertions, 40 deletions
diff --git a/priv/scrubbers/default.ex b/priv/scrubbers/default.ex
index e10e3ec87..d1215d2e0 100644
--- a/priv/scrubbers/default.ex
+++ b/priv/scrubbers/default.ex
@@ -33,35 +33,35 @@ defmodule Pleroma.HTML.Scrubber.Default do
"ugc"
])
- 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(:hr, [])
- 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(:strong, [])
- Meta.allow_tag_with_these_attributes(:sub, [])
- Meta.allow_tag_with_these_attributes(:sup, [])
- Meta.allow_tag_with_these_attributes(:ruby, [])
- Meta.allow_tag_with_these_attributes(:rb, [])
- Meta.allow_tag_with_these_attributes(:rp, [])
- Meta.allow_tag_with_these_attributes(:rt, [])
- Meta.allow_tag_with_these_attributes(:rtc, [])
- Meta.allow_tag_with_these_attributes(:u, [])
- Meta.allow_tag_with_these_attributes(:ul, [])
+ Meta.allow_tag_with_these_attributes(:a, ["name", "title", "lang"])
+
+ Meta.allow_tag_with_these_attributes(:abbr, ["title", "lang"])
+
+ Meta.allow_tag_with_these_attributes(:b, ["lang"])
+ Meta.allow_tag_with_these_attributes(:blockquote, ["lang"])
+ Meta.allow_tag_with_these_attributes(:br, ["lang"])
+ Meta.allow_tag_with_these_attributes(:code, ["lang"])
+ Meta.allow_tag_with_these_attributes(:del, ["lang"])
+ Meta.allow_tag_with_these_attributes(:em, ["lang"])
+ Meta.allow_tag_with_these_attributes(:hr, ["lang"])
+ Meta.allow_tag_with_these_attributes(:i, ["lang"])
+ Meta.allow_tag_with_these_attributes(:li, ["lang"])
+ Meta.allow_tag_with_these_attributes(:ol, ["lang"])
+ Meta.allow_tag_with_these_attributes(:p, ["lang"])
+ Meta.allow_tag_with_these_attributes(:pre, ["lang"])
+ Meta.allow_tag_with_these_attributes(:strong, ["lang"])
+ Meta.allow_tag_with_these_attributes(:sub, ["lang"])
+ Meta.allow_tag_with_these_attributes(:sup, ["lang"])
+ Meta.allow_tag_with_these_attributes(:ruby, ["lang"])
+ Meta.allow_tag_with_these_attributes(:rb, ["lang"])
+ Meta.allow_tag_with_these_attributes(:rp, ["lang"])
+ Meta.allow_tag_with_these_attributes(:rt, ["lang"])
+ Meta.allow_tag_with_these_attributes(:rtc, ["lang"])
+ Meta.allow_tag_with_these_attributes(:u, ["lang"])
+ Meta.allow_tag_with_these_attributes(:ul, ["lang"])
Meta.allow_tag_with_this_attribute_values(:span, "class", ["h-card", "recipients-inline"])
- Meta.allow_tag_with_these_attributes(:span, [])
+ Meta.allow_tag_with_these_attributes(:span, ["lang"])
Meta.allow_tag_with_this_attribute_values(:code, "class", ["inline"])
@@ -77,29 +77,30 @@ defmodule Pleroma.HTML.Scrubber.Default do
"width",
"height",
"title",
- "alt"
+ "alt",
+ "lang"
])
end
if Pleroma.Config.get([:markup, :allow_tables]) do
- Meta.allow_tag_with_these_attributes(:table, [])
- Meta.allow_tag_with_these_attributes(:tbody, [])
- Meta.allow_tag_with_these_attributes(:td, [])
- Meta.allow_tag_with_these_attributes(:th, [])
- Meta.allow_tag_with_these_attributes(:thead, [])
- Meta.allow_tag_with_these_attributes(:tr, [])
+ Meta.allow_tag_with_these_attributes(:table, ["lang"])
+ Meta.allow_tag_with_these_attributes(:tbody, ["lang"])
+ Meta.allow_tag_with_these_attributes(:td, ["lang"])
+ Meta.allow_tag_with_these_attributes(:th, ["lang"])
+ Meta.allow_tag_with_these_attributes(:thead, ["lang"])
+ Meta.allow_tag_with_these_attributes(:tr, ["lang"])
end
if Pleroma.Config.get([:markup, :allow_headings]) do
- Meta.allow_tag_with_these_attributes(:h1, [])
- Meta.allow_tag_with_these_attributes(:h2, [])
- Meta.allow_tag_with_these_attributes(:h3, [])
- Meta.allow_tag_with_these_attributes(:h4, [])
- Meta.allow_tag_with_these_attributes(:h5, [])
+ Meta.allow_tag_with_these_attributes(:h1, ["lang"])
+ Meta.allow_tag_with_these_attributes(:h2, ["lang"])
+ Meta.allow_tag_with_these_attributes(:h3, ["lang"])
+ Meta.allow_tag_with_these_attributes(:h4, ["lang"])
+ Meta.allow_tag_with_these_attributes(:h5, ["lang"])
end
if Pleroma.Config.get([:markup, :allow_fonts]) do
- Meta.allow_tag_with_these_attributes(:font, ["face"])
+ Meta.allow_tag_with_these_attributes(:font, ["face", "lang"])
end
Meta.strip_everything_not_covered()