Make Floki use fast_html

This commit is contained in:
rinpatch 2020-02-11 00:29:25 +03:00
parent 34cbe9f44a
commit 325c7c924b
2 changed files with 4 additions and 4 deletions

View file

@ -737,6 +737,8 @@
config :pleroma, :instances_favicons, enabled: false config :pleroma, :instances_favicons, enabled: false
config :floki, :html_parser, Floki.HTMLParser.FastHtml
# Import environment specific config. This must remain at the bottom # Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above. # of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs" import_config "#{Mix.env()}.exs"

View file

@ -9,13 +9,11 @@ defmodule Pleroma.Web.Metadata.Providers.RelMeTest do
test "it renders all links with rel='me' from user bio" do test "it renders all links with rel='me' from user bio" do
bio = bio =
~s(<a href="https://some-link.com">https://some-link.com</a> <a rel="me" href="https://another-link.com">https://another-link.com</a> ~s(<a href="https://some-link.com">https://some-link.com</a> <a rel="me" href="https://another-link.com">https://another-link.com</a> <link href="http://some.com"> <link rel="me" href="http://some3.com">)
<link href="http://some.com"> <link rel="me" href="http://some3.com>")
user = insert(:user, %{bio: bio}) user = insert(:user, %{bio: bio})
assert RelMe.build_tags(%{user: user}) == [ assert RelMe.build_tags(%{user: user}) == [
{:link, [rel: "me", href: "http://some3.com>"], []}, {:link, [rel: "me", href: "http://some3.com"], []},
{:link, [rel: "me", href: "https://another-link.com"], []} {:link, [rel: "me", href: "https://another-link.com"], []}
] ]
end end