class Sanitize

def initialize(config = {})

Returns a new Sanitize object initialized with the settings in _config_.
def initialize(config = {})
  # Sanitize configuration.
  @config = Config::DEFAULT.merge(config)
  @config[:transformers] = Array(@config[:transformers].dup)
  # Convert the list of allowed elements to a Hash for faster lookup.
  @allowed_elements = {}
  @config[:elements].each {|el| @allowed_elements[el] = true }
  # Convert the list of :remove_contents elements to a Hash for faster lookup.
  @remove_all_contents     = false
  @remove_element_contents = {}
  if @config[:remove_contents].is_a?(Array)
    @config[:remove_contents].each {|el| @remove_element_contents[el] = true }
  else
    @remove_all_contents = !!@config[:remove_contents]
  end
  # Specific nodes to whitelist (along with all their attributes). This array
  # is generated at runtime by transformers, and is cleared before and after
  # a fragment is cleaned (so it applies only to a specific fragment).
  @whitelist_nodes = []
end