module Kramdown::Options
def self.simple_array_validator(val, name, size = nil)
- or an array.
- a comma separated string which is split into an array of values
parameter +val+ can be
Ensures that the option value +val+ for the option called +name+ is a valid array. The
def self.simple_array_validator(val, name, size = nil) if String === val val = val.split(/,/) elsif !(Array === val) raise Kramdown::Error, "Invalid type #{val.class} for option #{name}" end if size && val.size != size raise Kramdown::Error, "Option #{name} needs exactly #{size} values" end val end