Compare commits
1 Commits
feature/sa
...
fix/dont-e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
effcc52ffd |
@ -34,10 +34,12 @@ defmodule Pleroma.Formatter do
|
|||||||
ap_id = get_ap_id(user)
|
ap_id = get_ap_id(user)
|
||||||
nickname_text = get_nickname_text(nickname, opts)
|
nickname_text = get_nickname_text(nickname, opts)
|
||||||
|
|
||||||
|
rel = if user.local, do: "ugc", else: "ugc canonical"
|
||||||
|
|
||||||
link =
|
link =
|
||||||
~s(<span class="h-card"><a data-user="#{id}" class="u-url mention" href="#{ap_id}" rel="ugc">@<span>#{
|
~s(<span class="h-card"><a data-user="#{id}" class="u-url mention" href="#{ap_id}" rel="#{
|
||||||
nickname_text
|
rel
|
||||||
}</span></a></span>)
|
}">@<span>#{nickname_text}</span></a></span>)
|
||||||
|
|
||||||
{link, %{acc | mentions: MapSet.put(acc.mentions, {"@" <> nickname, user})}}
|
{link, %{acc | mentions: MapSet.put(acc.mentions, {"@" <> nickname, user})}}
|
||||||
|
|
||||||
|
@ -26,7 +26,8 @@ defmodule Pleroma.HTML.Scrubber.Default do
|
|||||||
"nofollow",
|
"nofollow",
|
||||||
"noopener",
|
"noopener",
|
||||||
"noreferrer",
|
"noreferrer",
|
||||||
"ugc"
|
"ugc",
|
||||||
|
"ugc canonical"
|
||||||
])
|
])
|
||||||
|
|
||||||
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
||||||
|
@ -19,7 +19,8 @@ defmodule Pleroma.HTML.Scrubber.LinksOnly do
|
|||||||
"noopener",
|
"noopener",
|
||||||
"noreferrer",
|
"noreferrer",
|
||||||
"me",
|
"me",
|
||||||
"ugc"
|
"ugc",
|
||||||
|
"ugc canonical"
|
||||||
])
|
])
|
||||||
|
|
||||||
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
||||||
|
@ -26,7 +26,9 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do
|
|||||||
"tag",
|
"tag",
|
||||||
"nofollow",
|
"nofollow",
|
||||||
"noopener",
|
"noopener",
|
||||||
"noreferrer"
|
"noreferrer",
|
||||||
|
"ugc",
|
||||||
|
"ugc canonical"
|
||||||
])
|
])
|
||||||
|
|
||||||
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
Meta.allow_tag_with_these_attributes(:a, ["name", "title"])
|
||||||
|
@ -173,7 +173,7 @@ defmodule Pleroma.FormatterTest do
|
|||||||
expected_text =
|
expected_text =
|
||||||
~s(<span class="h-card"><a data-user="#{mike.id}" class="u-url mention" href="#{
|
~s(<span class="h-card"><a data-user="#{mike.id}" class="u-url mention" href="#{
|
||||||
mike.ap_id
|
mike.ap_id
|
||||||
}" rel="ugc">@<span>mike</span></a></span> test)
|
}" rel="ugc canonical">@<span>mike</span></a></span> test)
|
||||||
|
|
||||||
assert expected_text == text
|
assert expected_text == text
|
||||||
end
|
end
|
||||||
|
@ -1411,7 +1411,7 @@ defmodule Pleroma.UserTest do
|
|||||||
expected_text =
|
expected_text =
|
||||||
~s(A.k.a. <span class="h-card"><a data-user="#{remote_user.id}" class="u-url mention" href="#{
|
~s(A.k.a. <span class="h-card"><a data-user="#{remote_user.id}" class="u-url mention" href="#{
|
||||||
remote_user.ap_id
|
remote_user.ap_id
|
||||||
}" rel="ugc">@<span>nick@domain.com</span></a></span>)
|
}" rel="ugc canonical">@<span>nick@domain.com</span></a></span>)
|
||||||
|
|
||||||
assert expected_text == User.parse_bio(bio, user)
|
assert expected_text == User.parse_bio(bio, user)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user