class Haml::ForceEscape
Unlike Haml::Escape
, this escapes value even if it’s html_safe.
Public Class Methods
Source
# File lib/haml/force_escape.rb, line 15 def initialize(opts = {}) super @escape_code = options[:escape_code] || "::Haml::Util.escape_html((%s))" @escaper = eval("proc {|v| #{@escape_code % 'v'} }") end
Calls superclass method
Haml::Escape::new
Public Instance Methods
Source
# File lib/haml/force_escape.rb, line 25 def on_escape(flag, exp) [:escape, flag, compile(exp)] end
ForceEscape
doesn’t touch :escape expression. This method is not used if it’s inserted after Haml::Escape
.
Also aliased as: on_fescape