public
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/nex3/haml.git
-# with nested content works.


git-svn-id: svn://hamptoncatlin.com/haml/trunk@542 
7063305b-7217-0410-af8c-cdc13e5119b9
nex3 (author)
Mon Jul 02 23:49:07 -0700 2007
commit  ff2f08feaca66aeb47c2a8afcaebbfb5269367b1
tree    5f8cf2b3c840dcb66ab1658bd561bc14f8af1510
parent  dc2cda98c355f9c211f3bf3f97e69bbe72939091
0
...
1
2
3
4
5
6
...
1
2
 
3
4
5
0
@@ -1,6 +1,5 @@
0
 Bugs:
0
   If an @imported document is changed, Sass should recompile the template
0
- "bar= !foo" should work in Sass.
0
 
0
 Testing:
0
   Test html2haml and css2sass
...
250
251
252
253
 
254
255
256
...
329
330
331
 
 
332
333
334
...
524
525
526
 
 
 
 
 
 
 
527
528
529
...
538
539
540
 
 
541
542
543
...
591
592
593
 
 
 
 
 
594
595
596
...
250
251
252
 
253
254
255
256
...
329
330
331
332
333
334
335
336
...
526
527
528
529
530
531
532
533
534
535
536
537
538
...
547
548
549
550
551
552
553
554
...
602
603
604
605
606
607
608
609
610
611
612
0
@@ -250,7 +250,7 @@ END
0
 
0
               if flat
0
                 push_flat(old_uline, old_spaces)
0
- elsif !line_empty
0
+ elsif !line_empty && !@haml_comment
0
                 process_line(old_line, old_index, block_opened)
0
               end
0
 
0
@@ -329,6 +329,8 @@ END
0
           if (@block_opened && !mbk) || line[1..-1].split(' ', 2)[0] == "case"
0
             push_and_tabulate([:script])
0
           end
0
+ else
0
+ start_haml_comment
0
         end
0
       when FILTER
0
         name = line[1..-1].downcase
0
@@ -524,6 +526,13 @@ END
0
       end
0
     end
0
 
0
+ def start_haml_comment
0
+ if @block_opened
0
+ @haml_comment = true
0
+ push_and_tabulate([:haml_comment])
0
+ end
0
+ end
0
+
0
     # Closes the most recent item in <tt>@to_close_stack</tt>.
0
     def close
0
       tag, value = @to_close_stack.pop
0
@@ -538,6 +547,8 @@ END
0
         close_loud value
0
       when :filtered
0
         close_filtered value
0
+ when :haml_comment
0
+ close_haml_comment
0
       end
0
     end
0
 
0
@@ -591,6 +602,11 @@ END
0
       @filter_buffer = nil
0
       @template_tabs -= 1
0
     end
0
+
0
+ def close_haml_comment
0
+ @haml_comment = false
0
+ @template_tabs -= 1
0
+ end
0
     
0
     # Iterates through the classes and ids supplied through <tt>.</tt>
0
     # and <tt>#</tt> syntax, and returns a hash with them as attributes,
...
29
30
31
 
 
 
 
32
33
34
...
29
30
31
32
33
34
35
36
37
38
0
@@ -29,6 +29,10 @@
0
   cool, huh?
0
   %strong there can even be sub-tags!
0
   = "Or script!"
0
+-# Haml comment
0
+-#
0
+ Nested Haml comment
0
+ - raise 'dead'
0
 %p{ :class => "" } class attribute shouldn't appear!
0
 /[if lte IE6] conditional comment!
0
 /[if gte IE7]

Comments

    No one has commented yet.