From 9c736975bd467101f703864fb769988c11863678 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 5 Feb 2017 15:29:16 +0100 Subject: [PATCH] Fix showing ellipsis even when link hasn't been cut off --- app/lib/formatter.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index ff2a16f1b4..044407a6c1 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -68,8 +68,9 @@ class Formatter prefix = url.match(/\Ahttps?:\/\/(www\.)?/).to_s text = url[prefix.length, 30] suffix = url[prefix.length + 30..-1] + cutoff = url[prefix.length..-1].length > 30 - "#{prefix}#{text}#{suffix}" + "#{prefix}#{text}#{suffix}" end def hashtag_html(match)