1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix pattern to match various magic comment formats

This commit is contained in:
Akira Matsuda 2009-07-01 16:25:33 -07:00 committed by Yehuda Katz + Carl Lerche
parent 49824e8ad6
commit 92bff2ebf1

View file

@ -17,7 +17,7 @@ module ActionView
def compile(template)
require 'erb'
magic = $1 if template.source =~ /\A(<%#.*coding:\s*(\S+)\s*-?%>)/
magic = $1 if template.source =~ /\A(<%#.*coding[:=]\s*(\S+)\s*-?%>)/
erb = "#{magic}<% __in_erb_template=true %>#{template.source}"
::ERB.new(erb, nil, erb_trim_mode, '@output_buffer').src
end