class Hamlit::ForceEscapable
Unlike Hamlit::Escapable, this escapes value even if it's html_safe.
Public Class Methods
new(opts = {})
click to toggle source
Calls superclass method
Hamlit::Escapable.new
# File lib/hamlit/force_escapable.rb, line 14 def initialize(opts = {}) super @escape_code = options[:escape_code] || "::Hamlit::Utils.escape_html((%s))" @escaper = eval("proc {|v| #{@escape_code % 'v'} }") end
Public Instance Methods
on_escape(flag, exp)
click to toggle source
ForceEscapable doesn't touch :escape expression. This method is not used if it's inserted after Hamlit::Escapable.
# File lib/hamlit/force_escapable.rb, line 24 def on_escape(flag, exp) [:escape, flag, compile(exp)] end
Also aliased as: on_fescape