Don't destructively modify SafeBuffers.

Closes gh-399
Closes gh-400
This commit is contained in:
Nathan Weizenbaum 2011-06-07 19:12:06 -07:00
parent fb5ab2675f
commit fc5a5cb21d
3 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,8 @@
* Fix html2haml.
* Fix an issue where destructive modification was sometimes performed on Rails SafeBuffers.
## 3.1.1
* Update the vendored Sass to version 3.1.0.

View File

@ -379,7 +379,7 @@ END
value = Haml::Helpers.preserve(escaped)
if escape_attrs
# We want to decide whether or not to escape quotes
value.gsub!('"', '"')
value = value.gsub('"', '"')
this_attr_wrapper = attr_wrapper
if value.include? attr_wrapper
if value.include? other_quote_char

View File

@ -170,10 +170,10 @@ MESSAGE
result = capture_haml(i, &block)
if result.count("\n") > 1
result.gsub!("\n", "\n ")
result = result.gsub("\n", "\n ")
result = "\n #{result.strip}\n"
else
result.strip!
result = result.strip
end
"<li>#{result}</li>"