public
Rubygem
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/chriseppstein/haml.git
Search Repo:
Fixed an issue with multiline and empty lines.


git-svn-id: svn://hamptoncatlin.com/haml/branches/edge@170 
7063305b-7217-0410-af8c-cdc13e5119b9
nex3 (author)
Sun Nov 26 16:00:41 -0800 2006
commit  6bdf315c4f224ff0ecfa0771643efa5e58d7e55c
tree    ce559484c0bcf7997a1ef892402d2730a1cada48
parent  4e645138c0eb2e0c99d899a5fba4db3de98ca732
...
162
163
164
165
 
166
167
168
...
250
251
252
 
253
254
255
...
264
265
266
267
268
269
 
 
 
 
270
271
272
...
162
163
164
 
165
166
167
168
...
250
251
252
253
254
255
256
...
265
266
267
 
 
 
268
269
270
271
272
273
274
0
@@ -162,7 +162,7 @@ module Haml
0
           
0
           suppress_render = handle_multiline(old_tabs, old_line, old_index)
0
           
0
- if !suppress_render && old_spaces
0
+ if !suppress_render
0
             line_empty = old_line.empty?
0
             process_indent(old_tabs, old_line) unless line_empty
0
             flat = @flat_spaces != -1
0
@@ -250,6 +250,7 @@ module Haml
0
     # This returns whether or not the line should be
0
     # rendered normally.
0
     def handle_multiline(count, line, index)
0
+ suppress_render = false
0
       # Multilines are denoting by ending with a `|` (124)
0
       if is_multiline?(line) && @multiline_buffer
0
         # A multiline string is active, and is being continued
0
@@ -264,9 +265,10 @@ module Haml
0
         suppress_render = true
0
       elsif @multiline_buffer
0
         # A multiline string has just ended, make line into the result
0
- process_line(@multiline_buffer, @multiline_index, count > @multiline_count)
0
- @multiline_buffer = nil
0
- suppress_render = false
0
+ unless line.empty?
0
+ process_line(@multiline_buffer, @multiline_index, count > @multiline_count)
0
+ @multiline_buffer = nil
0
+ end
0
       end
0
 
0
       return suppress_render
...
69
70
71
72
 
 
 
...
69
70
71
 
72
73
74
0
@@ -69,4 +69,6 @@
0
 <strong>2</strong>
0
 <strong>3</strong>
0
 <strong>4</strong>
0
-
0
+<div class='test'>
0
+ <p>boom</p>
0
+</div>
...
32
33
34
 
 
 
 
 
 
...
32
33
34
35
36
37
38
39
40
0
@@ -32,3 +32,9 @@
0
     do |
0
       |a| |
0
   %strong= a
0
+.test
0
+ - "foo |
0
+ bar |
0
+ baz" |
0
+
0
+ %p boom

Comments

    No one has commented yet.