From 33f7e1cf996b9f87784cb1218885d9acbc718944 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 13 Oct 2016 16:49:52 +0200 Subject: Shorten rendered links (strip protocol and www, truncate to 30 chars), redirect to sign in page after sign up instead of root path which redirects to /about --- app/lib/formatter.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/lib') 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) -- cgit