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