app/helpers/decidim/proposals/map_helper.rb in decidim-proposals-0.23.4 vs app/helpers/decidim/proposals/map_helper.rb in decidim-proposals-0.23.5
- old
+ new
@@ -8,13 +8,17 @@
# Serialize a collection of geocoded proposals to be used by the dynamic map component
#
# geocoded_proposals - A collection of geocoded proposals
def proposals_data_for_map(geocoded_proposals)
geocoded_proposals.map do |proposal|
- proposal.slice(:latitude, :longitude, :address).merge(title: present(proposal).title,
- body: truncate(present(proposal).body, length: 100),
- icon: icon("proposals", width: 40, height: 70, remove_icon_class: true),
- link: proposal_path(proposal))
+ proposal
+ .slice(:latitude, :longitude, :address)
+ .merge(
+ title: decidim_html_escape(present(proposal).title),
+ body: html_truncate(decidim_sanitize(present(proposal).body), length: 100),
+ icon: icon("proposals", width: 40, height: 70, remove_icon_class: true),
+ link: proposal_path(proposal)
+ )
end
end
end
end
end