Module: Decidim::SanitizeHelper
- Includes:
- ActionView::Helpers::SanitizeHelper
- Included in:
- ActivityCell, AnnouncementCell, CardMCell, ContentBlocks::HeroCell, ContentBlocks::HighlightedContentBannerCell, ContentBlocks::SubHeroCell, Events::SimpleEvent, FingerprintCell, TosPageCell, TraceabilityHelper
- Defined in:
- app/helpers/decidim/sanitize_helper.rb
Overview
Helper that provides methods to render order selector and links
Instance Method Summary collapse
- #decidim_html_escape(text) ⇒ Object
-
#decidim_sanitize(html) ⇒ Object
Public: It sanitizes a user-inputted string with the ‘Decidim::UserInputScrubber` scrubber, so that video embeds work as expected.
Instance Method Details
#decidim_html_escape(text) ⇒ Object
19 20 21 |
# File 'app/helpers/decidim/sanitize_helper.rb', line 19 def decidim_html_escape(text) ERB::Util.unwrapped_html_escape(text.to_str) end |
#decidim_sanitize(html) ⇒ Object
Public: It sanitizes a user-inputted string with the ‘Decidim::UserInputScrubber` scrubber, so that video embeds work as expected. Uses Rails’ ‘sanitize` internally.
html - A string representing user-inputted HTML.
Returns an HTML-safe String.
15 16 17 |
# File 'app/helpers/decidim/sanitize_helper.rb', line 15 def decidim_sanitize(html) sanitize(html, scrubber: Decidim::UserInputScrubber.new) end |