X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fcommon_api%2Futils.ex;h=826160a23c0c3783ceffaaf184aab8a9380e98f2;hb=55b86e45ecd3ffa6048d98ead6a2557026692e1e;hp=b6feaf32a6304ac66a37690838cbeb531a27e85a;hpb=bc62a352820cf0cf56852e187b157b1d609a3ab3;p=akkoma diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index b6feaf32a..826160a23 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -283,6 +283,15 @@ defmodule Pleroma.Web.CommonAPI.Utils do |> Formatter.linkify(options) end + def format_input(text, "text/x.misskeymarkdown", options) do + text + |> Formatter.linkify(options) + |> Formatter.html_escape("text/x.misskeymarkdown") + |> (fn {text, mentions, tags} -> + {String.replace(text, ~r/\r?\n/, "
"), mentions, tags} + end).() + end + def format_input(text, "text/markdown", options) do text |> Formatter.mentions_escape(options)