weirdly no, images should not have classes
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Sat, 26 Nov 2022 21:15:10 +0000 (21:15 +0000)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Sat, 26 Nov 2022 21:15:10 +0000 (21:15 +0000)
priv/scrubbers/default.ex
test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs

index 950b6c21ee77dcb23520c48a74127ce027c23cc8..771f27ac1d08848dcb8e7ac44fd9d4f94b9164d4 100644 (file)
@@ -98,7 +98,6 @@ defmodule Pleroma.HTML.Scrubber.Default do
     Meta.allow_tag_with_these_attributes(:img, [
       "width",
       "height",
-      "class",
       "title",
       "alt"
     ])
index 133485a868e74757ed6ff0967f57e34aeb82d20d..739d9b49c43496ff6e5466bff6abf3a3d6b82607 100644 (file)
@@ -16,6 +16,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do
   this is an image: <img src="http://example.com/image.jpg"><br />
   <script>alert('hacked')</script>
   <div class="wow no classes here">mean</div>
+  <img class="hehe" src="somewhere" />
   """
 
   @expected """
@@ -27,6 +28,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do
   this is an image: <img src="http://example.com/image.jpg"/><br/>
   alert(&#39;hacked&#39;)
   mean
+  <img src="somewhere"/>
   """
 
   test "it filter html tags" do