Skip to content

Commit

Permalink
Fix pattern to match various magic comment formats
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda authored and Yehuda Katz + Carl Lerche committed Jul 1, 2009
1 parent 49824e8 commit 92bff2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/template/handlers/erb.rb
Expand Up @@ -17,7 +17,7 @@ class ERB < TemplateHandler
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
Expand Down

0 comments on commit 92bff2e

Please sign in to comment.