2017-12-14 16:23:15 +01:00
|
|
|
module ChampHelper
|
|
|
|
def is_not_header_nor_explication?(champ)
|
|
|
|
!['header_section', 'explication'].include?(champ.type_champ)
|
|
|
|
end
|
2018-02-28 17:14:00 +01:00
|
|
|
|
|
|
|
def html_formatted_description(description)
|
|
|
|
html_formatted = simple_format(description)
|
|
|
|
with_links = html_formatted.gsub(URI.regexp, '<a target="_blank" href="\0">\0</a>')
|
|
|
|
sanitize(with_links, attributes: %w(href target))
|
|
|
|
end
|
2017-12-14 16:23:15 +01:00
|
|
|
end
|