diff options
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/sanitize_helper.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/actionview/lib/action_view/helpers/sanitize_helper.rb b/actionview/lib/action_view/helpers/sanitize_helper.rb index e72e85ee5f..f95b83b3b2 100644 --- a/actionview/lib/action_view/helpers/sanitize_helper.rb +++ b/actionview/lib/action_view/helpers/sanitize_helper.rb @@ -31,19 +31,21 @@ module ActionView # (supply a Loofah::Scrubber that does the sanitization) # # scrubber can either wrap a block: - # scrubber = Loofah::Scrubber.new do |node| - # node.text = "dawn of cats" - # end # - # or be a subclass of Loofah::Scrubber which responds to scrub: - # class KittyApocalypse < Loofah::Scrubber - # def scrub(node) + # scrubber = Loofah::Scrubber.new do |node| # node.text = "dawn of cats" # end - # end - # scrubber = KittyApocalypse.new # - # <%= sanitize @article.body, scrubber: scrubber %> + # or be a subclass of Loofah::Scrubber which responds to scrub: + # + # class KittyApocalypse < Loofah::Scrubber + # def scrub(node) + # node.text = "dawn of cats" + # end + # end + # scrubber = KittyApocalypse.new + # + # <%= sanitize @article.body, scrubber: scrubber %> # # A custom scrubber takes precedence over custom tags and attributes # Learn more about scrubbers here: https://github.com/flavorjones/loofah |