Sha256: 9b7d796d4a2bad0876be35802809534db8b30e786527097fd52af0d14a5ba57f

Contents?: true

Size: 323 Bytes

Versions: 35

Compression:

Stored size: 323 Bytes

Contents

module Bergamasco
  module Sanitize
    ALLOWED_TAGS = Set.new(%w(strong em b i code pre sub sup br))

    def self.sanitize(text, options={})
      options[:tags] ||= ALLOWED_TAGS
      custom_scrubber = Bergamasco::WhitelistScrubber.new(options)

      Loofah.scrub_fragment(text, custom_scrubber).to_s
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
bergamasco-0.3.17 lib/bergamasco/sanitize.rb
bergamasco-0.3.16 lib/bergamasco/sanitize.rb
bergamasco-0.3.15 lib/bergamasco/sanitize.rb
bergamasco-0.3.14 lib/bergamasco/sanitize.rb
bergamasco-0.3.13 lib/bergamasco/sanitize.rb
bergamasco-0.3.12 lib/bergamasco/sanitize.rb
bergamasco-0.3.11 lib/bergamasco/sanitize.rb
bergamasco-0.3.10 lib/bergamasco/sanitize.rb
bergamasco-0.3.9 lib/bergamasco/sanitize.rb
bergamasco-0.3.8 lib/bergamasco/sanitize.rb
bergamasco-0.3.7 lib/bergamasco/sanitize.rb
bergamasco-0.3.6 lib/bergamasco/sanitize.rb
bergamasco-0.3.5 lib/bergamasco/sanitize.rb
bergamasco-0.3.4 lib/bergamasco/sanitize.rb
bergamasco-0.3.3 lib/bergamasco/sanitize.rb
bergamasco-0.3.2 lib/bergamasco/sanitize.rb
bergamasco-0.3.1 lib/bergamasco/sanitize.rb
bergamasco-0.3 lib/bergamasco/sanitize.rb
bergamasco-0.2.14 lib/bergamasco/sanitize.rb
bergamasco-0.2.13 lib/bergamasco/sanitize.rb