Sha256: 167756f91b40e61a53dcc4333c1dbed32d572d008381ebfb2bfc5e471ca035a5

Contents?: true

Size: 585 Bytes

Versions: 31

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Helper that provides methods to render order selector and links
  module SanitizeHelper
    include ActionView::Helpers::SanitizeHelper

    # 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.
    def decidim_sanitize(html)
      sanitize(html, scrubber: Decidim::UserInputScrubber.new)
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-core-0.10.1 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.10.0 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.9.3 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.9.2 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.9.1 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.9.0 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.8.4 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.8.3 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.8.2 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.8.1 app/helpers/decidim/sanitize_helper.rb
decidim-core-0.8.0 app/helpers/decidim/sanitize_helper.rb