Prevent empty html to be safe rendered to html with links

This commit is contained in:
Bertocq
2018-01-18 17:55:21 +01:00
parent e6e9e2db05
commit 06a1785445

View File

@@ -7,6 +7,7 @@ module TextWithLinksHelper
end
def safe_html_with_links(html)
return if html.nil?
return html.html_safe unless html.html_safe?
Rinku.auto_link(html, :all, 'target="_blank" rel="nofollow"').html_safe
end