formatter: Stop using phoenix HTML and format it ourselves

* Pheonix has an extra scheme whitelist conflicting with ours
* Pheonix doesn’t seems to do URL encoding, just HTML encoding

Closes: https://git.pleroma.social/pleroma/pleroma/issues/307
This commit is contained in:
Haelwenn (lanodan) Monnier 2018-09-28 17:20:28 +02:00
commit a3cffd3566
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
2 changed files with 11 additions and 10 deletions

View file

@ -222,13 +222,7 @@ defmodule Pleroma.Formatter do
subs =
subs ++
Enum.map(links, fn {uuid, url} ->
{:safe, link} = Phoenix.HTML.Link.link(url, to: url)
link =
link
|> IO.iodata_to_binary()
{uuid, link}
{uuid, "<a href=\"#{url}\">#{url}</a>"}
end)
{subs, uuid_text}