Class: Parliament::Utils::Services::ParliamentMarkdownScrubber
- Inherits:
-
Rails::Html::PermitScrubber
- Object
- Rails::Html::PermitScrubber
- Parliament::Utils::Services::ParliamentMarkdownScrubber
- Defined in:
- lib/parliament/utils/services/markdown_scrubber.rb
Instance Method Summary collapse
-
#initialize ⇒ ParliamentMarkdownScrubber
constructor
Overrides default sanitization allowing Parliament tags and/or attributes.
- #skip_node?(node) ⇒ Boolean
Constructor Details
#initialize ⇒ ParliamentMarkdownScrubber
Overrides default sanitization allowing Parliament tags and/or attributes
6 7 8 9 10 11 |
# File 'lib/parliament/utils/services/markdown_scrubber.rb', line 6 def initialize super self. = %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 |
Instance Method Details
#skip_node?(node) ⇒ Boolean
13 14 15 |
# File 'lib/parliament/utils/services/markdown_scrubber.rb', line 13 def skip_node?(node) node.text? || node.name === 'iframe' end |