Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/nex3/haml.git
Search Repo:
Fix for previous bug in stable tag.


git-svn-id: svn://hamptoncatlin.com/haml/tags/rel_1-0-2@274 
7063305b-7217-0410-af8c-cdc13e5119b9
nex3 (author)
Tue Jan 02 23:31:54 -0800 2007
commit  970ba243ee5d902b09830a860abe17fea0b8c86c
tree    f8f229e3f137f3cdb7901a4c5a4548d446d62a48
parent  d78fa94a704cfd0b3391cfd136d726836dcf2bc1
...
1
 
...
 
1
0
@@ -1 +1 @@
0
-1.0.1
0
+1.0.2
...
103
104
105
106
 
107
108
109
...
153
154
155
156
 
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
175
 
 
 
 
 
 
 
 
 
176
177
178
179
180
181
182
183
184
...
103
104
105
 
106
107
108
109
...
153
154
155
 
156
157
158
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
 
 
 
 
 
188
189
190
0
@@ -103,7 +103,7 @@ module Haml
0
       }.merge options
0
       @precompiled = @options[:precompiled]
0
 
0
- @template = template #String
0
+ @template = template.strip #String
0
       @to_close_stack = []
0
       @output_tabs = 0
0
       @template_tabs = 0
0
@@ -153,32 +153,38 @@ module Haml
0
       old_index = nil
0
       old_spaces = nil
0
       old_tabs = nil
0
- (@template + "\n\n").each_with_index do |line, index|
0
+ (@template + "\n-#").each_with_index do |line, index|
0
         spaces, tabs = count_soft_tabs(line)
0
         line = line.strip
0
         
0
- if old_line
0
- block_opened = tabs > old_tabs && !line.empty?
0
-
0
- suppress_render = handle_multiline(old_tabs, old_line, old_index)
0
-
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
-
0
- if flat
0
- push_flat(old_line, old_spaces)
0
- elsif !line_empty
0
- process_line(old_line, old_index, block_opened)
0
+ if !line.empty?
0
+ if old_line
0
+ block_opened = tabs > old_tabs && !line.empty?
0
+
0
+ suppress_render = handle_multiline(old_tabs, old_line, old_index)
0
+
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
+
0
+ if flat
0
+ push_flat(old_line, old_spaces)
0
+ elsif !line_empty
0
+ process_line(old_line, old_index, block_opened)
0
+ end
0
             end
0
           end
0
+
0
+ old_line = line
0
+ old_index = index
0
+ old_spaces = spaces
0
+ old_tabs = tabs
0
+ elsif @flat_spaces != -1
0
+ push_flat(old_line, old_spaces)
0
+ old_line = ''
0
+ old_spaces = 0
0
         end
0
-
0
- old_line = line
0
- old_index = index
0
- old_spaces = spaces
0
- old_tabs = tabs
0
       end
0
 
0
       # Close all the open tags
...
9
10
11
 
12
13
14
...
9
10
11
12
13
14
15
0
@@ -9,6 +9,7 @@
0
 <strong apos="Foo's bar!">Boo!</strong>
0
 <div class='render'><em>wow!</em></div>
0
 stuff followed by whitespace
0
+<strong>block with whitespace</strong>
0
 <p>
0
   Escape
0
   - character
...
36
37
38
39
 
40
41
42
...
36
37
38
 
39
40
41
42
0
@@ -36,7 +36,7 @@
0
   <pre>&#x000A; ___&#x000A; ,o88888&#x000A; ,o8888888'&#x000A; ,:o:o:oooo. ,8O88Pd8888"&#x000A; ,.::.::o:ooooOoOoO. ,oO8O8Pd888'"&#x000A; ,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"&#x000A; , ..:.::o:ooOoOOOO8OOOOo.FdO8O8"&#x000A; , ..:.::o:ooOoOO8O888O8O,COCOO"&#x000A; , . ..:.::o:ooOoOOOO8OOOOCOCO"&#x000A; . ..:.::o:ooOoOoOO8O8OCCCC"o&#x000A; . ..:.::o:ooooOoCoCCC"o:o&#x000A; . ..:.::o:o:,cooooCo"oo:o:&#x000A; ` . . ..:.:cocoooo"'o:o:::'&#x000A; .` . ..::ccccoc"'o:o:o:::'&#x000A; :.:. ,c:cccc"':.:.:.:.:.'&#x000A; ..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/&#x000A; ...:.'.:.::::"' . . . . .'&#x000A; .. . ....:."' ` . . . ''&#x000A; . . . ...."'&#x000A; .. . ."' -hrr-&#x000A; .&#x000A;&#x000A;&#x000A; It's a planet!&#x000A;%strong This shouldn't be bold!&#x000A;</pre>
0
   <strong>This should!</strong>
0
   <textarea>
0
- ___ ___ ___ ___&#x000A; /\__\ /\ \ /\__\ /\__\&#x000A; /:/ / /::\ \ /::| | /:/ /&#x000A; /:/__/ /:/\:\ \ /:|:| | /:/ /&#x000A; /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ /&#x000A; /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/&#x000A; \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \&#x000A; \::/ / \::/ / /:/ / \:\ \&#x000A; /:/ / /:/ / /:/ / \:\ \&#x000A; /:/ / /:/ / /:/ / \:\__\&#x000A; \/__/ \/__/ \/__/ \/__/&#x000A; &#x000A; Many&#x000A; thanks&#x000A; to&#x000A; http://www.network-science.de/ascii/&#x000A;
0
+ ___ ___ ___ ___&#x000A; /\__\ /\ \ /\__\ /\__\&#x000A; /:/ / /::\ \ /::| | /:/ /&#x000A; /:/__/ /:/\:\ \ /:|:| | /:/ /&#x000A; /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ /&#x000A; /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/&#x000A; \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \&#x000A; \::/ / \::/ / /:/ / \:\ \&#x000A; /:/ / /:/ / /:/ / \:\ \&#x000A; /:/ / /:/ / /:/ / \:\__\&#x000A; \/__/ \/__/ \/__/ \/__/&#x000A;&#x000A; Many&#x000A; thanks&#x000A; to&#x000A; http://www.network-science.de/ascii/&#x000A;
0
     <strong>indeed!</strong>
0
   </textarea>
0
 </div>
...
10
11
12
 
 
 
13
14
15
...
10
11
12
13
14
15
16
17
18
0
@@ -10,6 +10,9 @@
0
 .render= render :inline => "%em= 'wow!'", :type => :haml
0
 = "stuff followed by whitespace"
0
   
0
+- if true
0
+
0
+ %strong block with whitespace
0
 %p
0
   \Escape
0
   \- character

Comments

    No one has commented yet.