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

Protected Instance Methods

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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.