Files
fizzy/app/helpers/html_helper.rb
T
2026-03-20 12:13:17 +01:00

13 lines
359 B
Ruby

module HtmlHelper
def format_html(html)
@auto_link_scrubber ||= AutoLinkScrubber.new
Loofah::HTML5::DocumentFragment.parse(html).scrub!(@auto_link_scrubber).to_html.html_safe
end
def card_html_title(card)
return card.title if card.title.blank?
ERB::Util.html_escape(card.title).gsub(/`([^`]+)`/, '<code>\1</code>').html_safe
end
end