Sha256: 4020ba0482fbf2de3ada401fc3fa759ea254ce6a520eb777595e99010b229812
Contents?: true
Size: 599 Bytes
Versions: 7
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true module Decidim module ContentBlocks class SubHeroCell < Decidim::ViewModel def show return if translated_attribute(current_organization.description).blank? render end private def organization_description desc = decidim_sanitize_admin(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
7 entries across 7 versions & 1 rubygems