Sha256: ebec1de5eceb2c6a11b9bdb56a0839d21c75e29d3be8a8e324186f0a2643ec03

Contents?: true

Size: 639 Bytes

Versions: 1

Compression:

Stored size: 639 Bytes

Contents

module Parliament
  module Utils
    module Services
      class ParliamentMarkdownScrubber < Rails::Html::PermitScrubber
        # Overrides default sanitization allowing Parliament tags and/or attributes
        def initialize
          super
          self.tags = %w[p div h1 h2 h3 h4 h5 h6 span a ol li ul strong em i itag strike del u sup sub blockquote cite table thead tbody tfoot tr th td iframe image pre code dl dt dd hr br]
          self.attributes = %w[class href src name title allowfullscreen seamless frameborder style]
        end

        def skip_node?(node)
          node.text?
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parliament-utils-0.8.5 lib/parliament/utils/services/markdown_scrubber.rb