Remote Timeline: add Streaming support
[akkoma] / lib / pleroma / web / metadata / rel_me.ex
index f87fc197364f2588d6510ca0237ae1ffe5c7570c..8905c9c72f563ae4e7f69a32ffa569c27eab7b75 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Metadata.Providers.RelMe do
@@ -8,8 +8,10 @@ defmodule Pleroma.Web.Metadata.Providers.RelMe do
 
   @impl Provider
   def build_tags(%{user: user}) do
-    (Floki.attribute(user.bio, "link[rel~=me]", "href") ++
-       Floki.attribute(user.bio, "a[rel~=me]", "href"))
+    bio_tree = Floki.parse_fragment!(user.bio)
+
+    (Floki.attribute(bio_tree, "link[rel~=me]", "href") ++
+       Floki.attribute(bio_tree, "a[rel~=me]", "href"))
     |> Enum.map(fn link ->
       {:link, [rel: "me", href: link], []}
     end)