]> cat aescling's git repositories - mastodon.git/commitdiff
Add target=_blank to user note (#2622)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Sat, 29 Apr 2017 22:28:41 +0000 (07:28 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 29 Apr 2017 22:28:41 +0000 (00:28 +0200)
* Add target=_blank to user note

Open new window when click link from user profile in remote instance.

* fix rubocop

app/lib/sanitize_config.rb

index 7cf1c30626b549821613405d8974e631657e9cfa..90098969faca62a976d4a9901ed1619fc2dbcff5 100644 (file)
@@ -12,6 +12,13 @@ class Sanitize
         'span' => %w(class),
       },
 
+      add_attributes: {
+        'a' => {
+          'rel' => 'nofollow noopener',
+          'target' => '_blank',
+        },
+      },
+
       protocols: {
         'a' => { 'href' => HTTP_PROTOCOLS },
       }