allow small/center tags in misskeymarkdown (#132)
[akkoma] / lib / pleroma / web / common_api / utils.ex
index b6feaf32a6304ac66a37690838cbeb531a27e85a..826160a23c0c3783ceffaaf184aab8a9380e98f2 100644 (file)
@@ -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/, "<br>"), mentions, tags}
+        end).()
+  end
+
   def format_input(text, "text/markdown", options) do
     text
     |> Formatter.mentions_escape(options)