end)
end
- defp scrub_html_and_truncate(%{data: %{ "object" => %{ "content" => content}}} = activity) do
+ defp scrub_html_and_truncate(%{data: %{"object" => %{"content" => content}}} = activity) do
content
# html content comes from DB already encoded, decode first and scrub after
|> HtmlEntities.decode()
|> Formatter.truncate()
end
- defp scrub_html_and_truncate(content) do
+ defp scrub_html_and_truncate(content) when is_binary(content) do
content
# html content comes from DB already encoded, decode first and scrub after
|> HtmlEntities.decode()
|> HTML.strip_tags()
|> Formatter.truncate()
end
+
defp attachment_url(url) do
MediaProxy.url(url)
end