haml-edge 2.3.207 → 2.3.208
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 +4 -2
- data/lib/sass/tree/comment_node.rb +1 -1
- data/test/sass/conversion_test.rb +86 -0
- metadata +1 -1
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.208
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.208
|
data/lib/sass/engine.rb
CHANGED
@@ -234,7 +234,7 @@ module Sass
|
|
234
234
|
end
|
235
235
|
|
236
236
|
comment_tab_str ||= line_tab_str
|
237
|
-
if try_comment(line, lines.last, tab_str *
|
237
|
+
if try_comment(line, lines.last, tab_str * lines.last.tabs, comment_tab_str, index)
|
238
238
|
next
|
239
239
|
else
|
240
240
|
comment_tab_str = nil
|
@@ -256,7 +256,9 @@ END
|
|
256
256
|
|
257
257
|
def try_comment(line, last, tab_str, comment_tab_str, index)
|
258
258
|
return unless last && last.comment?
|
259
|
-
|
259
|
+
# Nested comment stuff must be at least one whitespace char deeper
|
260
|
+
# than the normal indentation
|
261
|
+
return unless line =~ /^#{tab_str}\s/
|
260
262
|
unless line =~ /^(?:#{comment_tab_str})(.*)$/
|
261
263
|
raise SyntaxError.new(<<MSG.strip.gsub("\n", " "), :line => index)
|
262
264
|
Inconsistent indentation:
|
@@ -286,6 +286,50 @@ foo bar
|
|
286
286
|
SASS
|
287
287
|
end
|
288
288
|
|
289
|
+
def test_nested_silent_comments
|
290
|
+
assert_renders <<SASS, <<SCSS
|
291
|
+
foo
|
292
|
+
bar: baz
|
293
|
+
// bip bop
|
294
|
+
// beep boop
|
295
|
+
bang: bizz
|
296
|
+
// bubble bubble
|
297
|
+
// toil trouble
|
298
|
+
SASS
|
299
|
+
foo {
|
300
|
+
bar: baz;
|
301
|
+
// bip bop
|
302
|
+
// beep boop
|
303
|
+
bang: bizz;
|
304
|
+
// bubble bubble
|
305
|
+
// toil trouble
|
306
|
+
}
|
307
|
+
SCSS
|
308
|
+
|
309
|
+
assert_sass_to_scss <<SCSS, <<SASS
|
310
|
+
foo {
|
311
|
+
bar: baz;
|
312
|
+
// bip bop
|
313
|
+
// beep boop
|
314
|
+
// bap blimp
|
315
|
+
bang: bizz;
|
316
|
+
// bubble bubble
|
317
|
+
// toil trouble
|
318
|
+
// gorp
|
319
|
+
}
|
320
|
+
SCSS
|
321
|
+
foo
|
322
|
+
bar: baz
|
323
|
+
// bip bop
|
324
|
+
beep boop
|
325
|
+
bap blimp
|
326
|
+
bang: bizz
|
327
|
+
// bubble bubble
|
328
|
+
toil trouble
|
329
|
+
gorp
|
330
|
+
SASS
|
331
|
+
end
|
332
|
+
|
289
333
|
def test_loud_comments
|
290
334
|
assert_renders <<SASS, <<SCSS
|
291
335
|
/* foo
|
@@ -354,6 +398,48 @@ foo bar {
|
|
354
398
|
SCSS
|
355
399
|
end
|
356
400
|
|
401
|
+
def test_nested_loud_comments
|
402
|
+
assert_renders <<SASS, <<SCSS
|
403
|
+
foo
|
404
|
+
bar: baz
|
405
|
+
/* bip bop
|
406
|
+
* beep boop
|
407
|
+
bang: bizz
|
408
|
+
/* bubble bubble
|
409
|
+
* toil trouble
|
410
|
+
SASS
|
411
|
+
foo {
|
412
|
+
bar: baz;
|
413
|
+
/* bip bop
|
414
|
+
* beep boop */
|
415
|
+
bang: bizz;
|
416
|
+
/* bubble bubble
|
417
|
+
* toil trouble */ }
|
418
|
+
SCSS
|
419
|
+
|
420
|
+
assert_sass_to_scss <<SCSS, <<SASS
|
421
|
+
foo {
|
422
|
+
bar: baz;
|
423
|
+
/* bip bop
|
424
|
+
* beep boop
|
425
|
+
* bap blimp */
|
426
|
+
bang: bizz;
|
427
|
+
/* bubble bubble
|
428
|
+
* toil trouble
|
429
|
+
* gorp */ }
|
430
|
+
SCSS
|
431
|
+
foo
|
432
|
+
bar: baz
|
433
|
+
/* bip bop
|
434
|
+
beep boop
|
435
|
+
bap blimp
|
436
|
+
bang: bizz
|
437
|
+
/* bubble bubble
|
438
|
+
toil trouble
|
439
|
+
gorp
|
440
|
+
SASS
|
441
|
+
end
|
442
|
+
|
357
443
|
def test_loud_comments_with_weird_indentation
|
358
444
|
assert_scss_to_sass <<SASS, <<SCSS
|
359
445
|
foo
|