63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'actionview/lib/action_view/template/handlers/erb.rb', line 63
def call(template, source)
template_source = source.b
erb = template_source.gsub(ENCODING_TAG, "")
encoding = $2
erb.force_encoding valid_encoding(source.dup, encoding)
erb.encode!
erb.chomp! if strip_trailing_newlines
options = {
escape: (self.class.escape_ignore_list.include? template.type),
trim: (self.class.erb_trim_mode == "-")
}
if ActionView::Base.annotate_rendered_view_with_filenames && template.format == :html
options[:preamble] = "@output_buffer.safe_append='<!-- BEGIN #{template.short_identifier} -->';"
options[:postamble] = "@output_buffer.safe_append='<!-- END #{template.short_identifier} -->';@output_buffer"
end
self.class.erb_implementation.new(erb, options).src
end
|