summaryrefslogtreecommitdiff
path: root/lib/plugins/link/html.ex
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/plugins/link/html.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/plugins/link/html.ex b/lib/plugins/link/html.ex
index bef9640..78f3192 100644
--- a/lib/plugins/link/html.ex
+++ b/lib/plugins/link/html.ex
@@ -30,7 +30,7 @@ defmodule Nola.Plugins.Link.HTML do
defp generate_text_from_opengraph(url, html, opengraph) do
itemprops = collect_itemprops(html)
prefix = collect_prefix_and_site_name(url, opengraph, itemprops)
- description = collect_description(opengraph, itemprops, 500)
+ description = collect_description(opengraph, itemprops, 400)
[clean_text("#{prefix}#{Map.get(opengraph, "title")}")] ++ description
end
@@ -138,7 +138,7 @@ defmodule Nola.Plugins.Link.HTML do
defp transform_description(nil, _), do: nil
defp transform_description(string, length) when is_binary(string) do
- if String.length(string) >= length, do: String.truncate(string, length), else: string
+ if String.length(string) > length, do: "#{String.slice(string, 0..length)}…", else: string
end
defp clean_text(text) do