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

[Haml] Handle frozen template strings.

Closes gh-197
This commit is contained in:
Nathan Weizenbaum 2010-06-22 15:20:33 -07:00
parent 5a82246393
commit 2e30ee55c9
2 changed files with 5 additions and 0 deletions

View file

@ -10,6 +10,10 @@
Support for Rails 3 versions prior to beta 4 has been removed.
Upgrade to Rails 3.0.0.beta4 if you haven't already.
### Minor Improvements
* Properly process frozen strings with encoding declarations.
## 3.0.12
[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12).

View file

@ -441,6 +441,7 @@ MSG
# @raise [ArgumentError] if the document declares an unknown encoding
def check_haml_encoding(str, &block)
return check_encoding(str, &block) if ruby1_8?
str = str.dup if str.frozen?
bom, encoding = parse_haml_magic_comment(str)
if encoding; str.force_encoding(encoding)