aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/metadata
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-03-04 20:47:34 +0300
committerMaxim Filippov <colixer@gmail.com>2019-03-04 20:47:34 +0300
commitcc7b35e0976a44d21c9f43999f42387ad0a87845 (patch)
tree00d9f0a7154889f6e812ad378d640a28ed643a0c /lib/pleroma/web/metadata
parentdd5865535eb16f535ff996eb3dec5e947a905268 (diff)
downloadpleroma-cc7b35e0976a44d21c9f43999f42387ad0a87845.tar.gz
Add status text to notifications (mentions and reposts)
Diffstat (limited to 'lib/pleroma/web/metadata')
-rw-r--r--lib/pleroma/web/metadata/utils.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/metadata/utils.ex b/lib/pleroma/web/metadata/utils.ex
index a166800d4..5fc9c9e7b 100644
--- a/lib/pleroma/web/metadata/utils.ex
+++ b/lib/pleroma/web/metadata/utils.ex
@@ -17,14 +17,14 @@ defmodule Pleroma.Web.Metadata.Utils do
|> Formatter.truncate()
end
- def scrub_html_and_truncate(content) when is_binary(content) do
+ def scrub_html_and_truncate(content, max_length \\ 200) when is_binary(content) do
content
# html content comes from DB already encoded, decode first and scrub after
|> HtmlEntities.decode()
|> String.replace(~r/<br\s?\/?>/, " ")
|> HTML.strip_tags()
|> Formatter.demojify()
- |> Formatter.truncate()
+ |> Formatter.truncate(max_length)
end
def attachment_url(url) do