Sha256: bbc094701ca84d60e8ed6d879c7253915959e548bcfd56430f0b0f4f3c72b317
Contents?: true
Size: 672 Bytes
Versions: 22
Compression:
Stored size: 672 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_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
22 entries across 22 versions & 1 rubygems