aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/formatter.ex
diff options
context:
space:
mode:
authoreal <eal@waifu.club>2017-12-07 21:34:25 +0200
committereal <eal@waifu.club>2017-12-07 21:36:06 +0200
commitbf91e5659ffd03b15110b6f1094b30aed940e45b (patch)
treeedb1dec37e87692bd4174bff4cf6564f001d1915 /lib/pleroma/formatter.ex
parentafd0ea37f3284bdfa6ddce99162601615b7ad845 (diff)
downloadpleroma-bf91e5659ffd03b15110b6f1094b30aed940e45b.tar.gz
Fix HTML escape breaking some links.
Diffstat (limited to 'lib/pleroma/formatter.ex')
-rw-r--r--lib/pleroma/formatter.ex9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex
index fbcbca979..275c60f32 100644
--- a/lib/pleroma/formatter.ex
+++ b/lib/pleroma/formatter.ex
@@ -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",