diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-05-28 13:51:21 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-05-28 13:51:21 -0500 |
commit | 39127f15eb36c4fb41838a232f9d80c50416838d (patch) | |
tree | da8cf563c6c4f5cfdaec14c4a5cddb808f0807e6 /lib/pleroma/web/common_api/utils.ex | |
parent | c23b81e399d5be6fc30f4acb1d757d5eb291d8e1 (diff) | |
parent | 7ad87571bdcd39959280d15f5bfe4175e04c442c (diff) | |
download | pleroma-39127f15eb36c4fb41838a232f9d80c50416838d.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into cycles-router-api-routes
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 10 |
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 |