Class: CommentScrubber
- Inherits:
-
Rails::Html::PermitScrubber
- Object
- Rails::Html::PermitScrubber
- CommentScrubber
- Defined in:
- app/helpers/comments_helper.rb
Overview
HTML sanitizer for use with comments.
Instance Method Summary collapse
-
#initialize ⇒ CommentScrubber
constructor
A new instance of CommentScrubber.
- #skip_node?(node) ⇒ Boolean
Constructor Details
#initialize ⇒ CommentScrubber
Returns a new instance of CommentScrubber.
141 142 143 144 145 |
# File 'app/helpers/comments_helper.rb', line 141 def initialize super self. = %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
147 148 149 |
# File 'app/helpers/comments_helper.rb', line 147 def skip_node?(node) node.text? end |