haml-edge 2.3.18 → 2.3.19
Sign up to get free protection for your applications and to get access to all the features.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/haml/filters.rb +1 -1
- data/test/haml/engine_test.rb +13 -0
- metadata +1 -1
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.19
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.19
|
data/lib/haml/filters.rb
CHANGED
@@ -100,7 +100,7 @@ module Haml
|
|
100
100
|
if contains_interpolation?(text)
|
101
101
|
return if options[:suppress_eval]
|
102
102
|
|
103
|
-
push_script <<RUBY
|
103
|
+
push_script <<RUBY, :escape_html => false
|
104
104
|
find_and_preserve(#{filter.inspect}.render_with_options(#{unescape_interpolation(text)}, _hamlout.options))
|
105
105
|
RUBY
|
106
106
|
return
|
data/test/haml/engine_test.rb
CHANGED
@@ -430,6 +430,19 @@ HAML
|
|
430
430
|
assert_equal("<a href='#'></a>\n", render('%a(href="#")'))
|
431
431
|
end
|
432
432
|
|
433
|
+
def test_javascript_filter_with_dynamic_interp_and_escape_html
|
434
|
+
assert_equal(<<HTML, render(<<HAML, :escape_html => true))
|
435
|
+
<script type='text/javascript'>
|
436
|
+
//<![CDATA[
|
437
|
+
& < > &
|
438
|
+
//]]>
|
439
|
+
</script>
|
440
|
+
HTML
|
441
|
+
:javascript
|
442
|
+
& < > \#{"&"}
|
443
|
+
HAML
|
444
|
+
end
|
445
|
+
|
433
446
|
# HTML escaping tests
|
434
447
|
|
435
448
|
def test_ampersand_equals_should_escape
|