blob: f1b800cb5338839290575b399b34e427f23a4062 (
plain) (
tree)
|
|
require 'erb'
class ERB
module Util
HTML_ESCAPE = { '&' => '&', '"' => '"', '>' => '>', '<' => '<' }
def html_escape(s)
s.to_s.gsub(/[&\"><]/) { |special| HTML_ESCAPE[special] }
end
end
end
module ActionView
module TemplateHandlers
class ERB < TemplateHandler
def compile(template)
::ERB.new(template, nil, @view.erb_trim_mode).src
end
end
end
end
|