diff options
Diffstat (limited to 'lib/pleroma/formatter.ex')
-rw-r--r-- | lib/pleroma/formatter.ex | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 515909af1..456416fbd 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -144,7 +144,7 @@ defmodule Pleroma.Formatter do @emoji end - @link_regex ~r/https?:\/\/[\w\.\/?=\-#\+%&@~\(\):]+[\w\/]/u + @link_regex ~r/https?:\/\/[\w\.\/?=\-#\+%&@~'\(\):]+[\w\/]/u def html_escape(text) do Regex.split(@link_regex, text, include_captures: true) @@ -168,7 +168,13 @@ defmodule Pleroma.Formatter do subs = subs ++ Enum.map(links, fn {uuid, url} -> - {uuid, "<a href='#{url}'>#{url}</a>"} + {:safe, link} = Phoenix.HTML.Link.link(url, to: url) + + link = + link + |> IO.iodata_to_binary() + + {uuid, link} end) {subs, uuid_text} |