Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into develop
[akkoma] / lib / pleroma / web / twitter_api / utils.ex
index 32b9eab44a6132a89c58943658e06d60779f46af..65d893869272c7e518e766d9fac005ccf0f54e3d 100644 (file)
@@ -38,7 +38,8 @@ defmodule Pleroma.Web.TwitterAPI.Utils do
     end)
 
     Enum.reduce(mentions, step_one, fn ({match, %User{ap_id: ap_id}, uuid}, text) ->
-      String.replace(text, uuid, "<a href='#{ap_id}'>#{match}</a>")
+      short_match = String.split(match, "@") |> tl() |> hd()
+      String.replace(text, uuid, "<a href='#{ap_id}'>@#{short_match}</a>")
     end)
   end