Skip to content

Commit

Permalink
[ci skip] Remove faulty overrides in scrubber example.
Browse files Browse the repository at this point in the history
Add initializer to CommentScrubber example replacing the method overrides with setting
tags and attributes.

Signed-off-by: Kasper Timm Hansen <kaspth@gmail.com>
  • Loading branch information
NeoElit authored and kaspth committed Apr 26, 2016
1 parent f6d1156 commit 57d549d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Expand Up @@ -99,17 +99,15 @@ You can also create custom scrubbers in your application if you want to.

```ruby
class CommentScrubber < Rails::Html::PermitScrubber
def allowed_node?(node)
!%w(form script comment blockquote).include?(node.name)
def initialize
super
self.tags = %w( form script comment blockquote )
self.attributes = %w( style )
end

def skip_node?(node)
node.text?
end

def scrub_attribute?(name)
name == "style"
end
end
```

Expand Down

0 comments on commit 57d549d

Please sign in to comment.