fix(formatter): keep links with formatted text in MFM posts
The email autolink clause also matched a link whose only child is an element, raised on "mailto:" <> element, and the rescue turned the whole post into escaped source text.
This commit is contained in:
parent
1f2179872a
commit
de6ac2392c
2 changed files with 12 additions and 1 deletions
|
|
@ -169,7 +169,8 @@ defmodule Pleroma.Formatter do
|
|||
Enum.map(nodes, &strip_email_autolinks(&1, emails))
|
||||
end
|
||||
|
||||
defp strip_email_autolinks({"a", attrs, [email], _meta} = node, emails) do
|
||||
defp strip_email_autolinks({"a", attrs, [email], _meta} = node, emails)
|
||||
when is_binary(email) do
|
||||
if List.keyfind(attrs, "href", 0) == {"href", "mailto:" <> email} and
|
||||
MapSet.member?(emails, email) do
|
||||
email
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue