Class: PostsHelper::PostScrubber

Inherits:
Rails::Html::PermitScrubber
  • Object
show all
Defined in:
app/helpers/posts_helper.rb

Instance Method Summary collapse

Constructor Details

#initializePostScrubber

Returns a new instance of PostScrubber.



67
68
69
70
71
72
73
# File 'app/helpers/posts_helper.rb', line 67

def initialize
  super
  # IF YOU CHANGE THESE VALUES YOU MUST ALSO CHANGE app/assets/javascripts/posts.js
  self.tags = %w[a p span b i em strong hr h1 h2 h3 h4 h5 h6 blockquote img strike del code pre br ul ol li sup sub
                 section details summary ins table thead tbody tr th td s]
  self.attributes = %w[id class href title src height width alt rowspan colspan lang start dir]
end

Instance Method Details

#skip_node?(node) ⇒ Boolean

Returns:

  • (Boolean)


75
76
77
# File 'app/helpers/posts_helper.rb', line 75

def skip_node?(node)
  node.text?
end