Interpret `\n` as newline for MFM
[akkoma] / lib / pleroma / formatter.ex
index 575bf9b2dcb20d3bc0ded04ea0abdb406cb6d0f1..fc841a55087f266fe6feb2021f06b82b1a89d287 100644 (file)
@@ -124,8 +124,8 @@ defmodule Pleroma.Formatter do
     end
   end
 
-  def markdown_to_html(text) do
-    Earmark.as_html!(text, %Earmark.Options{compact_output: true})
+  def markdown_to_html(text, opts \\ %{}) do
+    Earmark.as_html!(text, %Earmark.Options{compact_output: true} |> Map.merge(opts))
   end
 
   def html_escape({text, mentions, hashtags}, type) do