Add class=attachment to attachment links.
authorRoger Braun <roger@rogerbraun.net>
Mon, 8 May 2017 18:12:36 +0000 (20:12 +0200)
committerRoger Braun <roger@rogerbraun.net>
Mon, 8 May 2017 18:12:36 +0000 (20:12 +0200)
lib/pleroma/web/twitter_api/twitter_api.ex
test/web/twitter_api/twitter_api_test.exs

index 793a55250ce7ca3af8a571c2a5d84706df8cc8b3..d73ef3c7701d7355d62541e88283241f66b6d21a 100644 (file)
@@ -35,7 +35,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
   def add_attachments(text, attachments) do
     attachment_text = Enum.map(attachments, fn
       (%{"url" => [%{"href" => href} | _]}) ->
-        "<a href='#{href}'>#{href}</a>"
+        "<a href='#{href}' class='attachment'>#{href}</a>"
       _ -> ""
     end)
     Enum.join([text | attachment_text], "<br>")
index 9a7dc48dab42e472cd90e1413f21b8dd8509eb37..fd309e5ed2356c0f7ea915c1e016d557e1e60c1f 100644 (file)
@@ -33,7 +33,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
 
     { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input)
 
-    assert get_in(activity.data, ["object", "content"]) == "Hello again, <a href='shp'>@shp</a>.<br>This is on another line.<br><a href='http://example.org/image.jpg'>http://example.org/image.jpg</a>"
+    assert get_in(activity.data, ["object", "content"]) == "Hello again, <a href='shp'>@shp</a>.<br>This is on another line.<br><a href='http://example.org/image.jpg' class='attachment'>http://example.org/image.jpg</a>"
     assert get_in(activity.data, ["object", "type"]) == "Note"
     assert get_in(activity.data, ["object", "actor"]) == user.ap_id
     assert get_in(activity.data, ["actor"]) == user.ap_id