From 4c4c467b3e820510a4a2bb7a4ec8a0591d630d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Sun, 13 Sep 2015 18:02:19 +0200 Subject: [PATCH] adds html auto link helper --- app/helpers/text_with_links_helper.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/helpers/text_with_links_helper.rb b/app/helpers/text_with_links_helper.rb index 55281e89e..ca07daf39 100644 --- a/app/helpers/text_with_links_helper.rb +++ b/app/helpers/text_with_links_helper.rb @@ -6,4 +6,9 @@ module TextWithLinksHelper Rinku.auto_link(sanitized, :all, 'target="_blank" rel="nofollow"').html_safe end + def safe_html_with_links(html) + return html unless html.html_safe? + Rinku.auto_link(html, :all, 'target="_blank" rel="nofollow"').html_safe + end + end