public
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/nex3/haml.git
:ugly mode shouldn't mess with filter input.
nex3 (author)
Thu Jul 10 20:38:39 -0700 2008
commit  82a2571e683c187cdbf42527a168854b914baae6
tree    f8144c5c88ed559c66395560d6a54378f065549d
parent  07ffc82ee4c5255f5d9f3229d82d0db29a25e21e
...
303
304
305
306
307
308
309
310
311
312
 
 
 
313
314
315
...
303
304
305
 
 
 
 
 
 
 
306
307
308
309
310
311
0
@@ -303,13 +303,9 @@ END
0
 
0
     # Adds +text+ to <tt>@buffer</tt> while flattening text.
0
     def push_flat(line)
0
- unless @options[:ugly]
0
- tabulation = line.spaces - @flat_spaces
0
- tabulation = tabulation > -1 ? tabulation : 0
0
- @filter_buffer << "#{' ' * tabulation}#{line.unstripped}\n"
0
- else
0
- @filter_buffer << "#{line.unstripped}\n"
0
- end
0
+ tabulation = line.spaces - @flat_spaces
0
+ tabulation = tabulation > -1 ? tabulation : 0
0
+ @filter_buffer << "#{' ' * tabulation}#{line.unstripped}\n"
0
     end
0
 
0
     # Causes <tt>text</tt> to be evaluated in the context of
...
477
478
479
 
 
 
 
 
 
 
480
481
482
...
477
478
479
480
481
482
483
484
485
486
487
488
489
0
@@ -477,6 +477,13 @@ SOURCE
0
 END
0
   end
0
 
0
+ def test_ugly_filter
0
+ assert_equal(<<END, render(":sass\n #foo\n bar: baz", :ugly => true))
0
+#foo {
0
+ bar: baz; }
0
+END
0
+ end
0
+
0
   def test_local_assigns_dont_modify_class
0
     assert_equal("bar\n", render("= foo", :locals => {:foo => 'bar'}))
0
     assert_equal(nil, defined?(foo))

Comments

    No one has commented yet.