1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Metadata.Providers.RelMe do
6 alias Pleroma.Web.Metadata.Providers.Provider
10 def build_tags(%{user: user}) do
13 |> append_fields_tag(user.fields)
14 |> Floki.parse_fragment!()
16 (Floki.attribute(profile_tree, "link[rel~=me]", "href") ++
17 Floki.attribute(profile_tree, "a[rel~=me]", "href"))
18 |> Enum.map(fn link ->
19 {:link, [rel: "me", href: link], []}
23 defp append_fields_tag(bio, fields) do
25 |> Enum.reduce(bio, fn %{"value" => v}, res -> res <> v end)