From 2586229e38fedcbb71119aeb847ad34dff83cc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 6 Oct 2019 04:42:07 +0200 Subject: [PATCH] Remove duplication in TextWithLinksHelper We were using `Rinku.auto_link` the same way twice. And it makes sense that the method `sanitize_and_auto_link` first sanitizes the text and then calls `auto_link_already_sanitized_text`. --- app/helpers/text_with_links_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/text_with_links_helper.rb b/app/helpers/text_with_links_helper.rb index e1d8dbc54..c56082a73 100644 --- a/app/helpers/text_with_links_helper.rb +++ b/app/helpers/text_with_links_helper.rb @@ -3,7 +3,7 @@ module TextWithLinksHelper def sanitize_and_auto_link(text) return unless text sanitized = sanitize(text, tags: [], attributes: []) - Rinku.auto_link(sanitized, :all, 'target="_blank" rel="nofollow"').html_safe + auto_link_already_sanitized_html(sanitized) end def auto_link_already_sanitized_html(html)