Class | HTML::FullSanitizer |
In: |
vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
|
Parent: | Sanitizer |
# File vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 38 38: def process_node(node, result, options) 39: result << node.to_s if node.class == HTML::Text 40: end
# File vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 29 29: def sanitize(text, options = {}) 30: result = super 31: # strip any comments, and if they have a newline at the end (ie. line with 32: # only a comment) strip that too 33: result.gsub!(/<!--(.*?)-->[\n]?/m, "") if result 34: # Recurse - handle all dirty nested tags 35: result == text ? result : sanitize(result, options) 36: end