Allow authoring MFM
ci/woodpecker/push/release Pipeline was successful Details
ci/woodpecker/push/lint Pipeline failed Details
ci/woodpecker/push/test unknown status Details

This commit is contained in:
FloatingGhost 2022-06-14 15:56:12 +01:00
parent 3f06ccc9e3
commit 4fb2251221
4 changed files with 16 additions and 5 deletions

View File

@ -222,7 +222,8 @@ config :pleroma, :instance,
"text/plain",
"text/html",
"text/markdown",
"text/bbcode"
"text/bbcode",
"text/x.misskeymarkdown"
],
staff_transparency: [],
autofollowed_nicknames: [],

View File

@ -165,7 +165,7 @@ defmodule Pleroma.Emoji do
def maybe_quote(name), do: name
def emoji_url(%{"type" => "EmojiReact", "content" => emoji, "tag" => []}), do: nil
def emoji_url(%{"type" => "EmojiReact", "content" => _, "tag" => []}), do: nil
def emoji_url(%{"type" => "EmojiReact", "content" => emoji, "tag" => tags}) do
tag =

View File

@ -213,13 +213,14 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
end
emoji = Map.merge(emoji, summary_emoji)
{:ok, note_data, _meta} = Builder.note(draft)
object =
note_data
|> Map.put("emoji", emoji)
|> Map.put("source", draft.status)
|> Map.put("source", %{
"content" => draft.status,
"mediaType" => draft.params[:content_type]
})
|> Map.put("generator", draft.params[:generator])
%__MODULE__{draft | object: object}

View File

@ -291,6 +291,15 @@ defmodule Pleroma.Web.CommonAPI.Utils do
|> Formatter.html_escape("text/html")
end
def format_input(text, "text/x.misskeymarkdown", options) do
text
|> Formatter.html_escape("text/plain")
|> Formatter.linkify(options)
|> (fn {text, mentions, tags} ->
{String.replace(text, ~r/\r?\n/, "<br>"), mentions, tags}
end).()
end
def format_naive_asctime(date) do
date |> DateTime.from_naive!("Etc/UTC") |> format_asctime
end