1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/hamlit/escapable.rb
2015-11-28 03:39:09 +09:00

12 lines
335 B
Ruby

require 'hamlit/utils'
module Hamlit
class Escapable < Temple::Filters::Escapable
def initialize(opts = {})
super
@escape_code = options[:escape_code] ||
"::Hamlit::Utils.escape_html#{options[:use_html_safe] ? '_safe' : ''}((%s))"
@escaper = eval("proc {|v| #{@escape_code % 'v'} }")
end
end
end