diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b43e6b7ad..a3d1f944a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -85,7 +85,7 @@ module ApplicationHelper text = text.truncate(truncate) if truncate if url =~ %r!\Ahttps?://!i - link_to text, url, rel: "noreferrer nofollow", **link_options + link_to text, url, rel: "external noreferrer nofollow", **link_options else url end diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index 884663afc..2ce2f0143 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -61,9 +61,9 @@ module PostsHelper def post_source_tag(post) # Only allow http:// and https:// links. Disallow javascript: links. if post.source =~ %r!\Ahttps?://!i - external_link_to(post.normalized_source, strip: :subdomain, truncate: 20) + " ".html_safe + link_to("»", post.source, rel: "noreferrer nofollow") + external_link_to(post.normalized_source, strip: :subdomain) + " ".html_safe + link_to("»", post.source, rel: "external noreferrer nofollow") else - truncate(post.source, length: 100) + post.source end end diff --git a/app/javascript/src/styles/base/030_links.scss b/app/javascript/src/styles/base/030_links.scss index 6cf867630..54632a000 100644 --- a/app/javascript/src/styles/base/030_links.scss +++ b/app/javascript/src/styles/base/030_links.scss @@ -25,3 +25,7 @@ a.active { a.wiki-link { margin-right: 0.3em; } + +a[rel*="external"] { + word-break: break-all; +} diff --git a/app/javascript/src/styles/specific/posts.scss b/app/javascript/src/styles/specific/posts.scss index 0cf733034..f86268e3d 100644 --- a/app/javascript/src/styles/specific/posts.scss +++ b/app/javascript/src/styles/specific/posts.scss @@ -311,6 +311,10 @@ div#c-posts { font-weight: bold; } + #post-info-source { + word-break: break-all; + } + .recommended-posts { margin-top: 1em; } diff --git a/app/views/moderator/post/queues/_post.html.erb b/app/views/moderator/post/queues/_post.html.erb index 31d1b82e5..844681ebb 100644 --- a/app/views/moderator/post/queues/_post.html.erb +++ b/app/views/moderator/post/queues/_post.html.erb @@ -27,7 +27,7 @@