formatter: use class='mention' on links to user profiles
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 27 May 2018 12:53:14 +0000 (12:53 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sun, 27 May 2018 12:56:24 +0000 (12:56 +0000)
helps mastodon frontend and apps have better context:
https://mastodon.social/users/Gargron/statuses/100101267352899379

lib/pleroma/formatter.ex

index 53e2c204f30c0e6c542b00b63485ab0555ae7fa8..d23a284caf1966414a322e9a0eb3ad66a55d35e0 100644 (file)
@@ -200,7 +200,7 @@ defmodule Pleroma.Formatter do
           ap_id = info["source_data"]["url"] || ap_id
 
           short_match = String.split(match, "@") |> tl() |> hd()
-          {uuid, "<span><a href='#{ap_id}'>@<span>#{short_match}</span></a></span>"}
+          {uuid, "<span><a class='mention' href='#{ap_id}'>@<span>#{short_match}</span></a></span>"}
         end)
 
     {subs, uuid_text}