a8ce11a4d2
http://support.detectify.com/customer/portal/articles/2792257-external-links-using-target-_blank-
7 lines
269 B
Ruby
7 lines
269 B
Ruby
module StringToHtmlHelper
|
|
def string_to_html(str)
|
|
html_formatted = simple_format(str)
|
|
with_links = html_formatted.gsub(URI.regexp, '<a target="_blank" rel="noopener" href="\0">\0</a>')
|
|
sanitize(with_links, attributes: ['target', 'rel', 'href'])
|
|
end
|
|
end
|