module Presenting::Sanitize

Public Class Methods

h(val) click to toggle source

escape but preserve Arrays and Hashes

# File lib/presenting/sanitize.rb, line 6
def h(val)
  case val
  when Array
    val.map{|i| h(i)}
    
  when Hash
    val.clone.each{|k, v| val[h(k)] = h(v)}
    
  else
    html_escape(val)
  end
end