aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/utils.ex
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-05-16 13:22:26 -0500
committerAlex Gleason <alex@alexgleason.me>2021-05-16 13:22:26 -0500
commit7ac4da8dd4471455c7d243983d0e1ca6fa32a14e (patch)
treee0bf3be13a4e23ae5e16d08d08287b26fea3e0b3 /lib/pleroma/web/common_api/utils.ex
parent230ad82dadf013cb56909d1e8df2a2d652c47068 (diff)
parent745375bdcf2679ff803dd4ebc4a8313a7b5fb157 (diff)
downloadpleroma-7ac4da8dd4471455c7d243983d0e1ca6fa32a14e.tar.gz
Merge remote-tracking branch 'pleroma/develop' into gitignore-runtime-exs
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r--lib/pleroma/web/common_api/utils.ex10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index 9587dfa25..94a378e11 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -217,7 +217,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do
draft.status
|> format_input(content_type, options)
|> maybe_add_attachments(draft.attachments, attachment_links)
- |> maybe_add_nsfw_tag(draft.params)
end
defp get_content_type(content_type) do
@@ -228,13 +227,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do
end
end
- defp maybe_add_nsfw_tag({text, mentions, tags}, %{"sensitive" => sensitive})
- when sensitive in [true, "True", "true", "1"] do
- {text, mentions, [{"#nsfw", "nsfw"} | tags]}
- end
-
- defp maybe_add_nsfw_tag(data, _), do: data
-
def make_context(_, %Participation{} = participation) do
Repo.preload(participation, :conversation).conversation.ap_id
end
@@ -294,7 +286,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def format_input(text, "text/markdown", options) do
text
|> Formatter.mentions_escape(options)
- |> Earmark.as_html!(%Earmark.Options{renderer: Pleroma.EarmarkRenderer})
+ |> Formatter.markdown_to_html()
|> Formatter.linkify(options)
|> Formatter.html_escape("text/html")
end