Skip to content
Snippets Groups Projects
Commit 1418d727 authored by lain's avatar lain
Browse files

Add class=attachment to attachment links.

parent 8f9c4334
No related branches found
No related tags found
No related merge requests found
......@@ -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>")
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment