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 +1 -1
- data/VERSION +1 -1
- data/lib/haml/compiler.rb +1 -1
- data/lib/haml/exec.rb +1 -1
- data/lib/haml/helpers.rb +5 -3
- metadata +2 -2
data/REVISION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
5c22304b9d03505917f839dea9c84d39418e18d7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.0.alpha.
|
1
|
+
3.2.0.alpha.4
|
data/lib/haml/compiler.rb
CHANGED
@@ -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
|
data/lib/haml/exec.rb
CHANGED
data/lib/haml/helpers.rb
CHANGED
@@ -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
|
-
|
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
|
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.
|
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-
|
13
|
+
date: 2011-06-07 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|