fine then no fun allowed, y'all don't deserve it
[akkoma] / priv / scrubbers / default.ex
index 7b06994de1dce831d5a3d9584cf53d84463b001b..37ffaef3a0ba3e4ec9e3b0742020fe8dd9441f6e 100644 (file)
@@ -39,6 +39,7 @@ defmodule Pleroma.HTML.Scrubber.Default do
   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, [])
@@ -55,8 +56,36 @@ defmodule Pleroma.HTML.Scrubber.Default do
   Meta.allow_tag_with_these_attributes(:u, [])
   Meta.allow_tag_with_these_attributes(:ul, [])
 
-  Meta.allow_tag_with_this_attribute_values(:span, "class", ["h-card"])
-  Meta.allow_tag_with_these_attributes(:span, [])
+  Meta.allow_tag_with_this_attribute_values(:span, "class", [
+    "h-card",
+    "quote-inline",
+    "mfm",
+    "mfm _mfm_tada_",
+    "mfm _mfm_jelly_",
+    "mfm _mfm_twitch_",
+    "mfm _mfm_shake_",
+    "mfm _mfm_spin_",
+    "mfm _mfm_jump_",
+    "mfm _mfm_bounce_",
+    "mfm _mfm_flip_",
+    "mfm _mfm_x2_",
+    "mfm _mfm_x3_",
+    "mfm _mfm_x4_",
+    "mfm _mfm_blur_",
+    "mfm _mfm_rainbow_",
+    "mfm _mfm_rotate_"
+  ])
+
+  Meta.allow_tag_with_these_attributes(:span, [
+    "data-x",
+    "data-y",
+    "data-h",
+    "data-v",
+    "data-left",
+    "data-right"
+  ])
+
+  Meta.allow_tag_with_this_attribute_values(:code, "class", ["inline"])
 
   @allow_inline_images Pleroma.Config.get([:markup, :allow_inline_images])
 
@@ -67,7 +96,6 @@ defmodule Pleroma.HTML.Scrubber.Default do
     Meta.allow_tag_with_these_attributes(:img, [
       "width",
       "height",
-      "class",
       "title",
       "alt"
     ])
@@ -94,5 +122,10 @@ defmodule Pleroma.HTML.Scrubber.Default do
     Meta.allow_tag_with_these_attributes(:font, ["face"])
   end
 
+  Meta.allow_tag_with_these_attributes(:center, [])
+  Meta.allow_tag_with_these_attributes(:small, [])
+
   Meta.strip_everything_not_covered()
+
+  defp scrub_css(value), do: value
 end