Remove custom emojis and trailing whitespaces from previews
This commit is contained in:
parent
1b1af4798a
commit
997f4a5e09
3 changed files with 20 additions and 5 deletions
|
|
@ -103,7 +103,7 @@ defmodule Pleroma.Web.CommonAPI do
|
|||
attachments,
|
||||
tags,
|
||||
get_content_type(data["content_type"]),
|
||||
Enum.member?([true, "true"], data["no_attachment_links"])
|
||||
true
|
||||
),
|
||||
context <- make_context(inReplyTo),
|
||||
cw <- data["spoiler_text"],
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
|
|||
|> HtmlEntities.decode()
|
||||
|> String.replace(~r/<br\s?\/?>/, " ")
|
||||
|> HTML.get_cached_stripped_html_for_object(object, __MODULE__)
|
||||
|> Formatter.demojify()
|
||||
|> Formatter.truncate()
|
||||
end
|
||||
|
||||
|
|
@ -133,6 +134,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
|
|||
|> HtmlEntities.decode()
|
||||
|> String.replace(~r/<br\s?\/?>/, " ")
|
||||
|> HTML.strip_tags()
|
||||
|> Formatter.demojify()
|
||||
|> Formatter.truncate()
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue