1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/haml/escapable.rb
2021-07-27 23:14:58 -07:00

13 lines
357 B
Ruby

# frozen_string_literal: true
require 'haml/util'
module Haml
class Escapable < Temple::Filters::Escapable
def initialize(opts = {})
super
@escape_code = options[:escape_code] ||
"::Haml::Util.escape_html#{options[:use_html_safe] ? '_safe' : ''}((%s))"
@escaper = eval("proc {|v| #{@escape_code % 'v'} }")
end
end
end