Methods
Instance Public methods
sanitize(text, options = {})
Link
sanitizeable?(text)
Link
Instance Protected methods
process_node(node, result, options)
Link
tokenize(text, options)
Link
# File actionpack/lib/action_view/vendor/html-scanner/html/sanitizer.rb, line 18 def tokenize(text, options) tokenizer = HTML::Tokenizer.new(text) result = [] while token = tokenizer.next node = Node.parse(nil, 0, 0, token, false) process_node node, result, options end result end
validate_options(options)
Link
# File actionpack/lib/action_view/vendor/html-scanner/html/sanitizer.rb, line 32 def validate_options(options) if options[:tags] && !options[:tags].is_a?(Enumerable) raise ArgumentError, "You should pass :tags as an Enumerable" end if options[:attributes] && !options[:attributes].is_a?(Enumerable) raise ArgumentError, "You should pass :attributes as an Enumerable" end end