haml-edge 3.1.53 → 3.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/sass/engine.rb +3 -2
- data/lib/sass/tree/comment_node.rb +1 -1
- data/test/sass/engine_test.rb +26 -0
- data/test/sass/scss/css_test.rb +15 -1
- metadata +1 -1
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.54
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.54
|
data/lib/sass/engine.rb
CHANGED
@@ -667,13 +667,14 @@ WARNING
|
|
667
667
|
end
|
668
668
|
|
669
669
|
return silent ? "//" : "/* */" if content.empty?
|
670
|
+
content.last.gsub!(%r{ ?\*/ *$}, '')
|
670
671
|
content.map! {|l| l.gsub!(/^\*( ?)/, '\1') || (l.empty? ? "" : " ") + l}
|
671
672
|
content.first.gsub!(/^ /, '') unless removed_first
|
672
|
-
content.last.gsub!(%r{ ?\*/ *$}, '')
|
673
673
|
if silent
|
674
674
|
"//" + content.join("\n//")
|
675
675
|
else
|
676
|
-
|
676
|
+
# The #gsub fixes the case of a trailing */
|
677
|
+
"/*" + content.join("\n *").gsub(/ \*\Z/, '') + " */"
|
677
678
|
end
|
678
679
|
end
|
679
680
|
|
@@ -98,7 +98,7 @@ module Sass::Tree
|
|
98
98
|
spaces = (' ' * [tabs - 1 - value[/^ */].size, 0].max)
|
99
99
|
|
100
100
|
content = value.gsub(/^/, spaces)
|
101
|
-
content.gsub!(/\n +(\* *)?/, ' ') if style == :compact
|
101
|
+
content.gsub!(/\n +(\* *(?!\/))?/, ' ') if style == :compact
|
102
102
|
content
|
103
103
|
end
|
104
104
|
|
data/test/sass/engine_test.rb
CHANGED
@@ -1473,6 +1473,32 @@ foo
|
|
1473
1473
|
SASS
|
1474
1474
|
end
|
1475
1475
|
|
1476
|
+
def test_loud_comment_with_close
|
1477
|
+
assert_equal <<CSS, render(<<SASS)
|
1478
|
+
foo {
|
1479
|
+
/* foo
|
1480
|
+
* bar */ }
|
1481
|
+
CSS
|
1482
|
+
foo
|
1483
|
+
/* foo
|
1484
|
+
bar */
|
1485
|
+
SASS
|
1486
|
+
end
|
1487
|
+
|
1488
|
+
def test_loud_comment_with_separate_line_close
|
1489
|
+
assert_equal <<CSS, render(<<SASS)
|
1490
|
+
foo {
|
1491
|
+
/* foo
|
1492
|
+
* bar
|
1493
|
+
*/ }
|
1494
|
+
CSS
|
1495
|
+
foo
|
1496
|
+
/* foo
|
1497
|
+
* bar
|
1498
|
+
*/
|
1499
|
+
SASS
|
1500
|
+
end
|
1501
|
+
|
1476
1502
|
def test_attribute_selector_with_spaces
|
1477
1503
|
assert_equal(<<CSS, render(<<SASS))
|
1478
1504
|
a b[foo=bar] {
|
data/test/sass/scss/css_test.rb
CHANGED
@@ -393,7 +393,7 @@ SCSS
|
|
393
393
|
assert_equal <<CSS, render(<<SCSS)
|
394
394
|
foo {
|
395
395
|
a: -0.5em;
|
396
|
-
b:
|
396
|
+
b: 0.5em;
|
397
397
|
c: -foo(12px);
|
398
398
|
d: +foo(12px); }
|
399
399
|
CSS
|
@@ -866,6 +866,20 @@ SCSS
|
|
866
866
|
assert_equal 1, e.sass_line
|
867
867
|
end
|
868
868
|
|
869
|
+
## Regressions
|
870
|
+
|
871
|
+
def test_closing_line_comment_end_with_compact_output
|
872
|
+
assert_equal(<<CSS, render(<<SCSS, :style => :compact))
|
873
|
+
/* foo */
|
874
|
+
bar { baz: bang; }
|
875
|
+
CSS
|
876
|
+
/*
|
877
|
+
* foo
|
878
|
+
*/
|
879
|
+
bar {baz: bang}
|
880
|
+
SCSS
|
881
|
+
end
|
882
|
+
|
869
883
|
private
|
870
884
|
|
871
885
|
def assert_selector_parses(selector)
|