aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/utils.ex
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2019-04-12 19:25:53 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2019-04-12 19:25:53 +0000
commit334b2d78dc068f65fabf5b11aaa737dfd742d2f4 (patch)
tree69bcbc3e76b891cb3f702ff3a7ade7b451f09083 /lib/pleroma/web/common_api/utils.ex
parent184ae60b217f4e3a79aad538717d1cf35f10291a (diff)
parentf9af90c5aa42169b929f4ac6b352730b4d3416c7 (diff)
downloadpleroma-334b2d78dc068f65fabf5b11aaa737dfd742d2f4.tar.gz
Merge branch 'improve-formatter' into 'develop'
Improve formatter and update `auto_linker` Closes #795 See merge request pleroma/pleroma!1036
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r--lib/pleroma/web/common_api/utils.ex5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index 7b9f0ea06..58a561a40 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -195,11 +195,10 @@ defmodule Pleroma.Web.CommonAPI.Utils do
Formatting text to markdown.
"""
def format_input(text, "text/markdown", options) do
- options = Keyword.put(options, :mentions_escape, true)
-
text
+ |> Formatter.mentions_escape(options)
+ |> Earmark.as_html!()
|> Formatter.linkify(options)
- |> (fn {text, mentions, tags} -> {Earmark.as_html!(text), mentions, tags} end).()
|> Formatter.html_escape("text/html")
end