aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/metadata
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-02-16 01:55:26 +0300
committerrinpatch <rinpatch@sdf.org>2020-02-16 01:55:26 +0300
commit472132215e871306ca69f2bab1ed884b0f65e7c2 (patch)
treef3ce1bd91c44686dc1754d28117ded2b7b2a0a2b /lib/pleroma/web/metadata
parent0b5a2bbe5b08d8b02c2b72c7b80fb55a7dc12535 (diff)
downloadpleroma-472132215e871306ca69f2bab1ed884b0f65e7c2.tar.gz
Use floki's new APIs for parsing fragments
Diffstat (limited to 'lib/pleroma/web/metadata')
-rw-r--r--lib/pleroma/web/metadata/rel_me.ex6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pleroma/web/metadata/rel_me.ex b/lib/pleroma/web/metadata/rel_me.ex
index f87fc1973..86dcc1a3b 100644
--- a/lib/pleroma/web/metadata/rel_me.ex
+++ b/lib/pleroma/web/metadata/rel_me.ex
@@ -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)