X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fhtml.ex;h=20b02f091f52c2828c8c79f92101b85ab635f32c;hb=0ab03e856480c35ce9478d086f103b396a8e7453;hp=d78c5f2025ced17c45649393954cc164841dd8d2;hpb=0f386110c6e15148ff1ff5ea3451885485fcb7ff;p=akkoma diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex index d78c5f202..20b02f091 100644 --- a/lib/pleroma/html.ex +++ b/lib/pleroma/html.ex @@ -109,8 +109,9 @@ defmodule Pleroma.HTML do result = content |> Floki.parse_fragment!() - |> Floki.filter_out("a.mention,a.hashtag,a[rel~=\"tag\"]") - |> Floki.attribute("a", "href") + |> Floki.find("a:not(.mention,.hashtag,.attachment,[rel~=\"tag\"])") + |> Enum.take(1) + |> Floki.attribute("href") |> Enum.at(0) {:commit, {:ok, result}}