diff options
author | lambda <pleromagit@rogerbraun.net> | 2018-08-31 09:53:00 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2018-08-31 09:53:00 +0000 |
commit | d31bbb1cfe04ca6073a322bcf77239e7d4b79839 (patch) | |
tree | ba9a5a9e33b4afb79044c5d8da663b150010bd68 /lib/pleroma/web/common_api/utils.ex | |
parent | 340ab3cb9068d444b77213e07beb8c2c3ca128b9 (diff) | |
parent | 58539e13573681238fdd4d4e7334666389084be3 (diff) | |
download | pleroma-d31bbb1cfe04ca6073a322bcf77239e7d4b79839.tar.gz |
Merge branch 'revert-a26d5e6b' into 'develop'
Revert "Merge branch 'feature/rich-text' into 'develop'"
See merge request pleroma/pleroma!313
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index 667027c02..358ca22ac 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -63,16 +63,9 @@ defmodule Pleroma.Web.CommonAPI.Utils do end end - def make_content_html( - status, - mentions, - attachments, - tags, - content_type, - no_attachment_links \\ false - ) do + def make_content_html(status, mentions, attachments, tags, no_attachment_links \\ false) do status - |> format_input(mentions, tags, content_type) + |> format_input(mentions, tags) |> maybe_add_attachments(attachments, no_attachment_links) end @@ -99,9 +92,9 @@ defmodule Pleroma.Web.CommonAPI.Utils do Enum.join([text | attachment_text], "<br>") end - def format_input(text, mentions, tags, "text/plain") do + def format_input(text, mentions, tags) do text - |> Formatter.html_escape("text/plain") + |> Formatter.html_escape() |> String.replace(~r/\r?\n/, "<br>") |> (&{[], &1}).() |> Formatter.add_links() @@ -110,25 +103,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do |> Formatter.finalize() end - def format_input(text, mentions, tags, "text/html") do - text - |> Formatter.html_escape("text/html") - |> String.replace(~r/\r?\n/, "<br>") - |> (&{[], &1}).() - |> Formatter.add_user_links(mentions) - |> Formatter.finalize() - end - - def format_input(text, mentions, tags, "text/markdown") do - text - |> Earmark.as_html!() - |> Formatter.html_escape("text/html") - |> String.replace(~r/\r?\n/, "") - |> (&{[], &1}).() - |> Formatter.add_user_links(mentions) - |> Formatter.finalize() - end - def add_tag_links(text, tags) do tags = tags |