Parent

Class Index [+]

Quicksearch

HTML::Sanitizer

Public Instance Methods

sanitize(text, options = {}) click to toggle source
    # File lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 7
 7:     def sanitize(text, options = {})
 8:       return text unless sanitizeable?(text)
 9:       tokenize(text, options).join
10:     end
sanitizeable?(text) click to toggle source
    # File lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 12
12:     def sanitizeable?(text)
13:       !(text.nil? || text.empty? || !text.index("<"))
14:     end

Protected Instance Methods

process_node(node, result, options) click to toggle source
    # File lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 27
27:     def process_node(node, result, options)
28:       result << node.to_s
29:     end
tokenize(text, options) click to toggle source
    # File lib/action_controller/vendor/html-scanner/html/sanitizer.rb, line 17
17:     def tokenize(text, options)
18:       tokenizer = HTML::Tokenizer.new(text)
19:       result = []
20:       while token = tokenizer.next
21:         node = Node.parse(nil, 0, 0, token, false)
22:         process_node node, result, options
23:       end
24:       result
25:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.