Sha256: 32bd35f8de7cabed4ceb10697a1af512dd2032c99aa09f4cdb186a7b206929cf
Contents?: true
Size: 1.35 KB
Versions: 13
Compression:
Stored size: 1.35 KB
Contents
# frozen_string_literal: true module Decidim module Proposals # A module with all the hash tags common methods for proposals # and collaborative draft commands. module HashtagsMethods private def title_with_hashtags @title_with_hashtags ||= Decidim::ContentProcessor.parse_with_processor(:hashtag, form.title, current_organization: form.current_organization).rewrite end def body_with_hashtags @body_with_hashtags ||= begin ret = Decidim::ContentProcessor.parse(form.body, current_organization: form.current_organization).rewrite.strip ret += "\n\n#{body_extra_hashtags.strip}" unless body_extra_hashtags.empty? ret end end def body_extra_hashtags @body_extra_hashtags ||= if form.respond_to?(:extra_hashtags) Decidim::ContentProcessor.parse_with_processor( :hashtag, form.extra_hashtags.map { |hashtag| "##{hashtag}" }.join(" "), current_organization: form.current_organization, extra_hashtags: true ).rewrite else "" end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems