mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-23 16:44:04 -05:00
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
This commit is contained in:
parent
157f03f8bd
commit
33f7e1cf99
@ -17,6 +17,6 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def after_sign_up_path_for(_resource)
|
def after_sign_up_path_for(_resource)
|
||||||
root_path
|
new_user_session_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,7 +29,9 @@ class Formatter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def link_urls(html)
|
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
|
end
|
||||||
|
|
||||||
def link_mentions(html, mentions)
|
def link_mentions(html, mentions)
|
||||||
|
@ -17,7 +17,7 @@ RSpec.describe Formatter do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'contains a link' do
|
it 'contains a link' do
|
||||||
expect(subject).to match('<a rel="nofollow noopener" href="http://google.com">http://google.com</a>')
|
expect(subject).to match('<a rel="nofollow noopener" href="http://google.com">google.com</a>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user