Revert "simplify mentions escape"

This reverts commit f3e06a1030636f24f7129dd93bb9780e67fb7de1.
This commit is contained in:
Egor 2019-04-12 19:25:53 +00:00 committed by Haelwenn
commit f9af90c5aa
4 changed files with 37 additions and 14 deletions

View file

@ -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