mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fix pattern to match various magic comment formats
This commit is contained in:
committed by
Yehuda Katz + Carl Lerche
parent
49824e8ad6
commit
92bff2ebf1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user