about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/formatter.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 17d2dfc58..60bc3733e 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -29,7 +29,9 @@ class Formatter
   end
 
   def link_urls(html)
-    auto_link(html, link: :urls, html: { rel: 'nofollow noopener' })
+    auto_link(html, link: :urls, html: { rel: 'nofollow noopener' }) do |text|
+      truncate(text.gsub(/\Ahttps?:\/\/(www\.)?/, ''), length: 30)
+    end
   end
 
   def link_mentions(html, mentions)