about summary refs log tree commit diff
path: root/app/lib/sanitize_config.rb
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-04-30 07:28:41 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-04-30 00:28:41 +0200
commit4a5f73c8aef7500a0efe7d800447e288674bf54a (patch)
tree6ae89bda8a105568465ea66e9878bec8ae05584d /app/lib/sanitize_config.rb
parentfdcf884cf719b682e413ee047542861b5a5cf3b7 (diff)
Add target=_blank to user note (#2622)
* Add target=_blank to user note

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

* fix rubocop
Diffstat (limited to 'app/lib/sanitize_config.rb')
-rw-r--r--app/lib/sanitize_config.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb
index 7cf1c3062..90098969f 100644
--- a/app/lib/sanitize_config.rb
+++ b/app/lib/sanitize_config.rb
@@ -12,6 +12,13 @@ class Sanitize
         'span' => %w(class),
       },
 
+      add_attributes: {
+        'a' => {
+          'rel' => 'nofollow noopener',
+          'target' => '_blank',
+        },
+      },
+
       protocols: {
         'a' => { 'href' => HTTP_PROTOCOLS },
       }