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