aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-06-11 19:23:35 -0500
committerMark Felder <feld@feld.me>2021-06-11 19:23:35 -0500
commitbb4130d48c4831e704155b45fed889dc71efd254 (patch)
tree9a779d4da13b0d53440f083e32422aa17ab9ca04 /lib
parent45146b00106840095405950908d4c13aee370772 (diff)
downloadpleroma-bb4130d48c4831e704155b45fed889dc71efd254.tar.gz
Demojify does not decode for us
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/metadata/utils.ex6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pleroma/web/metadata/utils.ex b/lib/pleroma/web/metadata/utils.ex
index 0a4a3f628..4c763a877 100644
--- a/lib/pleroma/web/metadata/utils.ex
+++ b/lib/pleroma/web/metadata/utils.ex
@@ -36,8 +36,9 @@ defmodule Pleroma.Web.Metadata.Utils do
end
defp do_filter_html_and_truncate(content, max_length \\ 200) when is_binary(content) do
- # html content comes from DB already encoded, but demojify decodes for us
+ # html content comes from DB already encoded
content
+ |> HtmlEntities.decode()
|> Emoji.Formatter.demojify()
|> HTML.filter_tags(Pleroma.HTML.Scrubber.BreaksOnly)
|> HtmlEntities.decode()
@@ -46,8 +47,9 @@ defmodule Pleroma.Web.Metadata.Utils do
end
defp do_scrub_html_and_truncate(content, max_length \\ 200) when is_binary(content) do
- # html content comes from DB already encoded, but demojify decodes for us
+ # html content comes from DB already encoded
content
+ |> HtmlEntities.decode()
|> Emoji.Formatter.demojify()
|> String.replace(~r/<br\s?\/?>/, " ")
|> HTML.strip_tags()