haml 3.2.0.alpha.3 → 3.2.0.alpha.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of haml might be problematic. Click here for more details.

data/REVISION CHANGED
@@ -1 +1 @@
1
- 881d7e66546964138bcc0458302d97b62e6e703a
1
+ 5c22304b9d03505917f839dea9c84d39418e18d7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.0.alpha.3
1
+ 3.2.0.alpha.4
@@ -379,7 +379,7 @@ END
379
379
  value = Haml::Helpers.preserve(escaped)
380
380
  if escape_attrs
381
381
  # We want to decide whether or not to escape quotes
382
- value.gsub!('"', '"')
382
+ value = value.gsub('"', '"')
383
383
  this_attr_wrapper = attr_wrapper
384
384
  if value.include? attr_wrapper
385
385
  if value.include? other_quote_char
@@ -9,7 +9,7 @@ module Haml
9
9
  # @param args [Array<String>] The command-line arguments
10
10
  def initialize(args)
11
11
  @args = args
12
- @options = {}
12
+ @options = {:for_engine => {}}
13
13
  end
14
14
 
15
15
  # Parses the command-line arguments and runs the executable.
@@ -107,7 +107,9 @@ MESSAGE
107
107
  # @yield The block within which to escape newlines
108
108
  def find_and_preserve(input = nil, tags = haml_buffer.options[:preserve], &block)
109
109
  return find_and_preserve(capture_haml(&block), input || tags) if block
110
- input.to_s.gsub(/<(#{tags.map(&Regexp.method(:escape)).join('|')})([^>]*)>(.*?)(<\/\1>)/im) do
110
+ re = /<(#{tags.map(&Regexp.method(:escape)).join('|')})([^>]*)>(.*?)(<\/\1>)/im
111
+ input.to_s.gsub(re) do |s|
112
+ s =~ re # Can't rely on $1, etc. existing since Rails' SafeBuffer#gsub is incompatible
111
113
  "<#{$1}#{$2}>#{preserve($3)}</#{$1}>"
112
114
  end
113
115
  end
@@ -170,10 +172,10 @@ MESSAGE
170
172
  result = capture_haml(i, &block)
171
173
 
172
174
  if result.count("\n") > 1
173
- result.gsub!("\n", "\n ")
175
+ result = result.gsub("\n", "\n ")
174
176
  result = "\n #{result.strip}\n"
175
177
  else
176
- result.strip!
178
+ result = result.strip
177
179
  end
178
180
 
179
181
  "<li>#{result}</li>"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0.alpha.3
4
+ version: 3.2.0.alpha.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-10 00:00:00 -04:00
13
+ date: 2011-06-07 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency