instiki/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb

22 lines
419 B
Ruby
Raw Normal View History

require 'erb'
class ERB
module Util
HTML_ESCAPE = { '&' => '&amp;', '"' => '&quot;', '>' => '&gt;', '<' => '&lt;' }
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