From 4a5f73c8aef7500a0efe7d800447e288674bf54a Mon Sep 17 00:00:00 2001
From: Yamagishi Kazutoshi <ykzts@desire.sh>
Date: Sun, 30 Apr 2017 07:28:41 +0900
Subject: [PATCH] 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
---
 app/lib/sanitize_config.rb | 7 +++++++
 1 file changed, 7 insertions(+)

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 },
       }