fine then no fun allowed, y'all don't deserve it
[akkoma] / priv / scrubbers / default.ex
index 153b0be453499aea33f4c9394daaf0183df6aae3..37ffaef3a0ba3e4ec9e3b0742020fe8dd9441f6e 100644 (file)
@@ -56,8 +56,34 @@ 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", "quote-inline"])
-  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"])
 
@@ -70,7 +96,6 @@ defmodule Pleroma.HTML.Scrubber.Default do
     Meta.allow_tag_with_these_attributes(:img, [
       "width",
       "height",
-      "class",
       "title",
       "alt"
     ])
@@ -101,4 +126,6 @@ defmodule Pleroma.HTML.Scrubber.Default do
   Meta.allow_tag_with_these_attributes(:small, [])
 
   Meta.strip_everything_not_covered()
+
+  defp scrub_css(value), do: value
 end