[#491] Made full nicknames be preserved in user links text only in Bio.
This commit is contained in:
parent
2bfae25a1f
commit
65bb9b2fba
6 changed files with 47 additions and 16 deletions
|
|
@ -874,4 +874,19 @@ defmodule Pleroma.UserTest do
|
|||
Pleroma.Config.put([:instance, :account_activation_required], false)
|
||||
end
|
||||
end
|
||||
|
||||
describe "parse_bio/2" do
|
||||
test "preserves hosts in user links text" do
|
||||
remote_user = insert(:user, local: false, nickname: "nick@domain.com")
|
||||
user = insert(:user)
|
||||
bio = "A.k.a. @nick@domain.com"
|
||||
|
||||
expected_text =
|
||||
"A.k.a. <span class='h-card'><a data-user='#{remote_user.id}' class='u-url mention' href='#{
|
||||
remote_user.ap_id
|
||||
}'>" <> "@<span>nick@domain.com</span></a></span>"
|
||||
|
||||
assert expected_text == User.parse_bio(bio, user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue