diff options
Diffstat (limited to 'app/lib/text_formatter.rb')
-rw-r--r-- | app/lib/text_formatter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/lib/text_formatter.rb b/app/lib/text_formatter.rb index 48e2fc233..03a695cf8 100644 --- a/app/lib/text_formatter.rb +++ b/app/lib/text_formatter.rb @@ -64,7 +64,7 @@ class TextFormatter indices.last end - result << h(text[last_index..-1]) + result << h(text[last_index..]) result end @@ -75,8 +75,8 @@ class TextFormatter prefix = url.match(URL_PREFIX_REGEX).to_s display_url = url[prefix.length, 30] - suffix = url[prefix.length + 30..-1] - cutoff = url[prefix.length..-1].length > 30 + suffix = url[prefix.length + 30..] + cutoff = url[prefix.length..].length > 30 <<~HTML.squish <a href="#{h(url)}" target="_blank" rel="#{rel.join(' ')}"><span class="invisible">#{h(prefix)}</span><span class="#{cutoff ? 'ellipsis' : ''}">#{h(display_url)}</span><span class="invisible">#{h(suffix)}</span></a> |