Sha256: 690a600841c0909ad180419dac712cbbe760bf87c80b7f0d96083d3f34ad52cf
Contents?: true
Size: 666 Bytes
Versions: 16
Compression:
Stored size: 666 Bytes
Contents
# frozen_string_literal: true module Decidim module ContentBlocks class SubHeroCell < Decidim::ViewModel include Decidim::IconHelper include Decidim::SanitizeHelper def show return if translated_attribute(current_organization.description).blank? render end private def organization_description desc = decidim_sanitize(translated_attribute(current_organization.description)) # Strip the surrounding paragraph tag because it is not allowed within # a <hN> element. desc.gsub(%r{</p>\s+<p>}, "<br><br>").gsub(%r{<p>(((?!</p>).)*)</p>}mi, "\\1") end end end end
Version data entries
16 entries across 16 versions & 1 rubygems