module Kramdown::Options

def self.simple_hash_validator(val, name)

- or a Ruby Hash object.
- a hash in YAML format

parameter +val+ can be
Ensures that the option value +val+ for the option called +name+ is a valid hash. The
def self.simple_hash_validator(val, name)
  if String === val
    begin
      val = YAML.load(val)
    rescue RuntimeError, ArgumentError, SyntaxError
      raise Kramdown::Error, "Invalid YAML value for option #{name}"
    end
  end
  raise Kramdown::Error, "Invalid type #{val.class} for option #{name}" if !(Hash === val)
  val
end