Method: AntiSamy::SaxFilter#convert_array

Defined in:
lib/antisamy/html/sax_filter.rb

#convert_array(x) ⇒ Object



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/antisamy/html/sax_filter.rb', line 68

def convert_array(x)
  if x and x.first.is_a?(Array)
    return x
  end
  i = 0
  h = []
  while i < x.size
    m = []
    m[0] = x[i]
    m[1] = x[i+1]
    h << m
    i += 2
  end
  h
end