Remove custom emojis and trailing whitespaces from previews

This commit is contained in:
rinpatch 2019-01-18 10:28:19 +03:00
commit 997f4a5e09
3 changed files with 20 additions and 5 deletions

View file

@ -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"],

View file

@ -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