Class: HTML::Sanitizer
- Inherits:
-
Object
- Object
- HTML::Sanitizer
- Defined in:
- actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
Instance Method Summary (collapse)
Instance Method Details
- (Object) sanitize(text, options = {})
6 7 8 9 |
# File 'actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb', line 6 def sanitize(text, = {}) return text unless sanitizeable?(text) tokenize(text, ).join end |
- (Boolean) sanitizeable?(text)
11 12 13 |
# File 'actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb', line 11 def sanitizeable?(text) !(text.nil? || text.empty? || !text.index("<")) end |