Class: CommentScrubber

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

Overview

HTML sanitizer for use with comments.

Instance Method Summary collapse

Constructor Details

#initializeCommentScrubber

Returns a new instance of CommentScrubber.



141
142
143
144
145
# File 'app/helpers/comments_helper.rb', line 141

def initialize
  super
  self.tags = %w[a b i em strong s strike del pre code p blockquote span sup sub br ul ol li]
  self.attributes = %w[href title lang dir id class start]
end

Instance Method Details

#skip_node?(node) ⇒ Boolean

Returns:

  • (Boolean)


147
148
149
# File 'app/helpers/comments_helper.rb', line 147

def skip_node?(node)
  node.text?
end