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