[Fix #1801] rename and move html_formatted_description in a generic helper

This commit is contained in:
Mathieu Magnin 2018-05-24 18:01:40 +02:00
parent 0635b50d70
commit 152cf03d72
3 changed files with 10 additions and 9 deletions

View file

@ -0,0 +1,7 @@
module StringToHtmlHelper
def string_to_html(str)
html_formatted = simple_format(str)
with_links = html_formatted.gsub(URI.regexp, '<a target="_blank" href="\0">\0</a>')
sanitize(with_links, attributes: %w(href target))
end
end