haml-edge 2.3.207 → 2.3.208

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 2.3.207
1
+ 2.3.208
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.207
1
+ 2.3.208
@@ -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 * (lines.last.tabs + 1), comment_tab_str, index)
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
- return unless line =~ /^#{tab_str}/
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:
@@ -67,8 +67,8 @@ module Sass::Tree
67
67
  end
68
68
  end
69
69
 
70
- content.gsub!(/^/, ' ' * tabs)
71
70
  content.gsub!(/\A\/\*/, '//') if silent
71
+ content.gsub!(/^/, ' ' * tabs)
72
72
  content.rstrip + "\n"
73
73
  end
74
74
 
@@ -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
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.207
4
+ version: 2.3.208
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum