haml-edge 2.3.32 → 2.3.33
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/precompiler.rb +3 -3
- data/test/haml/engine_test.rb +18 -0
- metadata +3 -3
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.33
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.33
|
data/lib/haml/precompiler.rb
CHANGED
@@ -79,7 +79,7 @@ module Haml
|
|
79
79
|
#
|
80
80
|
# The block is ended after <tt>%p no!</tt>, because <tt>else</tt>
|
81
81
|
# is a member of this array.
|
82
|
-
MID_BLOCK_KEYWORD_REGEX =
|
82
|
+
MID_BLOCK_KEYWORD_REGEX = /^-\s*(#{%w[else elsif rescue ensure when end].join('|')})\b/
|
83
83
|
|
84
84
|
# The Regex that matches a Doctype command.
|
85
85
|
DOCTYPE_REGEX = /(\d\.\d)?[\s]*([a-z]*)/i
|
@@ -228,9 +228,9 @@ END
|
|
228
228
|
newline_now
|
229
229
|
|
230
230
|
# Handle stuff like - end.join("|")
|
231
|
-
@to_close_stack.first << false if text =~
|
231
|
+
@to_close_stack.first << false if text =~ /^-\s*end\b/ && !block_opened?
|
232
232
|
|
233
|
-
case_stmt = text =~
|
233
|
+
case_stmt = text =~ /^-\s*case\b/
|
234
234
|
block = block_opened? && !mid_block_keyword?(text)
|
235
235
|
push_and_tabulate([:script]) if block || case_stmt
|
236
236
|
push_and_tabulate(:nil) if block && case_stmt
|
data/test/haml/engine_test.rb
CHANGED
@@ -473,6 +473,24 @@ HTML
|
|
473
473
|
HAML
|
474
474
|
end
|
475
475
|
|
476
|
+
def test_silent_script_with_hyphen_case
|
477
|
+
assert_equal("", render("- 'foo-case-bar-case'"))
|
478
|
+
end
|
479
|
+
|
480
|
+
def test_silent_script_with_hyphen_end
|
481
|
+
assert_equal("", render("- 'foo-end-bar-end'"))
|
482
|
+
end
|
483
|
+
|
484
|
+
def test_silent_script_with_hyphen_end_and_block
|
485
|
+
assert_equal(<<HTML, render(<<HAML))
|
486
|
+
<p>foo-end</p>
|
487
|
+
<p>bar-end</p>
|
488
|
+
HTML
|
489
|
+
- "foo-end-bar-end".gsub(/\\w+-end/) do |s|
|
490
|
+
%p= s
|
491
|
+
HAML
|
492
|
+
end
|
493
|
+
|
476
494
|
# HTML escaping tests
|
477
495
|
|
478
496
|
def test_ampersand_equals_should_escape
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -44,10 +44,10 @@ extensions: []
|
|
44
44
|
|
45
45
|
extra_rdoc_files:
|
46
46
|
- README.md
|
47
|
-
- VERSION
|
48
47
|
- REVISION
|
49
48
|
- CONTRIBUTING
|
50
49
|
- MIT-LICENSE
|
50
|
+
- VERSION
|
51
51
|
- VERSION_NAME
|
52
52
|
- EDGE_GEM_VERSION
|
53
53
|
files:
|
@@ -255,10 +255,10 @@ files:
|
|
255
255
|
- init.rb
|
256
256
|
- .yardopts
|
257
257
|
- README.md
|
258
|
-
- VERSION
|
259
258
|
- REVISION
|
260
259
|
- CONTRIBUTING
|
261
260
|
- MIT-LICENSE
|
261
|
+
- VERSION
|
262
262
|
- VERSION_NAME
|
263
263
|
- EDGE_GEM_VERSION
|
264
264
|
has_rdoc: true
|