Skip to content
Snippets Groups Projects
Commit bf91e565 authored by eal's avatar eal
Browse files

Fix HTML escape breaking some links.

parent afd0ea37
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,15 @@ defmodule Pleroma.Formatter do
|> Enum.filter(fn ({_match, user}) -> user end)
end
def html_escape(text) do
Regex.split(@link_regex, text, include_captures: true)
|> Enum.map_every(2, fn chunk ->
{:safe, part} = Phoenix.HTML.html_escape(chunk)
part
end)
|> Enum.join("")
end
@finmoji [
"a_trusted_friend",
"alandislands",
......
......@@ -58,8 +58,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do
end
def format_input(text, mentions, _tags) do
Phoenix.HTML.html_escape(text)
|> elem(1)
text
|> Formatter.html_escape
|> Formatter.linkify
|> String.replace("\n", "<br>")
|> add_user_links(mentions)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment