When reading inline templates, don't set encoding
for each line, but only once for the complete file.
This commit is contained in:
parent
ff18f868a9
commit
8240bb7fbb
|
@ -930,13 +930,14 @@ module Sinatra
|
|||
end
|
||||
lines = app.count("\n") + 1
|
||||
template = nil
|
||||
force_encoding data, encoding
|
||||
data.each_line do |line|
|
||||
lines += 1
|
||||
if line =~ /^@@\s*(.*\S)\s*$/
|
||||
template = force_encoding('', encoding)
|
||||
templates[$1.to_sym] = [template, file, lines]
|
||||
elsif template
|
||||
template << force_encoding(line, encoding)
|
||||
template << line
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue