mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
12 lines
335 B
Ruby
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
|