public
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/mislav/haml.git
Fix another line-reporting bug in Haml.
nex3 (author)
Fri May 02 00:48:39 -0700 2008
commit  1693be0bce7eb616a7e69c3930b824da6f64b57b
tree    227caec43bf3daab2bbd184e203901b0b1a8cc76
parent  d77e383dc861e976919dbb238aea147d12519239
...
139
140
141
 
142
143
144
...
748
749
750
 
751
752
753
...
139
140
141
142
143
144
145
...
749
750
751
752
753
754
755
0
@@ -139,6 +139,7 @@ END
0
 
0
         if old_line.text.nil? || suppress_render
0
           old_line = line
0
+ resolve_newlines
0
           newline
0
           next
0
         end
0
@@ -748,6 +749,7 @@ END
0
     end
0
 
0
     def resolve_newlines
0
+ return unless @newlines > 0
0
       @precompiled << "\n" * @newlines
0
       @newlines = 0
0
     end
...
35
36
37
38
 
 
39
40
41
...
35
36
37
 
38
39
40
41
42
0
@@ -35,7 +35,8 @@ END
0
 
0
     # Regression tests
0
     "- raise 'foo'\n\n\n\nbar" => ["foo", 1],
0
- "= 'foo'\n-raise 'foo'" => ["foo", 2]
0
+ "= 'foo'\n-raise 'foo'" => ["foo", 2],
0
+ "\n\n\n- raise 'foo'" => ["foo", 4],
0
   }
0
 
0
   User = Struct.new('User', :id)

Comments

    No one has commented yet.