haml 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of haml might be problematic. Click here for more details.

data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -103,7 +103,7 @@ module Haml
103
103
  }.merge options
104
104
  @precompiled = @options[:precompiled]
105
105
 
106
- @template = template #String
106
+ @template = template.strip #String
107
107
  @to_close_stack = []
108
108
  @output_tabs = 0
109
109
  @template_tabs = 0
@@ -153,32 +153,38 @@ module Haml
153
153
  old_index = nil
154
154
  old_spaces = nil
155
155
  old_tabs = nil
156
- (@template + "\n\n").each_with_index do |line, index|
156
+ (@template + "\n-#").each_with_index do |line, index|
157
157
  spaces, tabs = count_soft_tabs(line)
158
158
  line = line.strip
159
159
 
160
- if old_line
161
- block_opened = tabs > old_tabs && !line.empty?
162
-
163
- suppress_render = handle_multiline(old_tabs, old_line, old_index)
164
-
165
- if !suppress_render
166
- line_empty = old_line.empty?
167
- process_indent(old_tabs, old_line) unless line_empty
168
- flat = @flat_spaces != -1
169
-
170
- if flat
171
- push_flat(old_line, old_spaces)
172
- elsif !line_empty
173
- process_line(old_line, old_index, block_opened)
160
+ if !line.empty?
161
+ if old_line
162
+ block_opened = tabs > old_tabs && !line.empty?
163
+
164
+ suppress_render = handle_multiline(old_tabs, old_line, old_index)
165
+
166
+ if !suppress_render
167
+ line_empty = old_line.empty?
168
+ process_indent(old_tabs, old_line) unless line_empty
169
+ flat = @flat_spaces != -1
170
+
171
+ if flat
172
+ push_flat(old_line, old_spaces)
173
+ elsif !line_empty
174
+ process_line(old_line, old_index, block_opened)
175
+ end
174
176
  end
175
177
  end
178
+
179
+ old_line = line
180
+ old_index = index
181
+ old_spaces = spaces
182
+ old_tabs = tabs
183
+ elsif @flat_spaces != -1
184
+ push_flat(old_line, old_spaces)
185
+ old_line = ''
186
+ old_spaces = 0
176
187
  end
177
-
178
- old_line = line
179
- old_index = index
180
- old_spaces = spaces
181
- old_tabs = tabs
182
188
  end
183
189
 
184
190
  # Close all the open tags
@@ -9,6 +9,7 @@
9
9
  <strong apos="Foo's bar!">Boo!</strong>
10
10
  <div class='render'><em>wow!</em></div>
11
11
  stuff followed by whitespace
12
+ <strong>block with whitespace</strong>
12
13
  <p>
13
14
  Escape
14
15
  - character
@@ -36,7 +36,7 @@
36
36
  <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>
37
37
  <strong>This should!</strong>
38
38
  <textarea>
39
- ___ ___ ___ ___&#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;
39
+ ___ ___ ___ ___&#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;
40
40
  <strong>indeed!</strong>
41
41
  </textarea>
42
42
  </div>
@@ -10,6 +10,9 @@
10
10
  .render= render :inline => "%em= 'wow!'", :type => :haml
11
11
  = "stuff followed by whitespace"
12
12
 
13
+ - if true
14
+
15
+ %strong block with whitespace
13
16
  %p
14
17
  \Escape
15
18
  \- character
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: haml
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.1
7
- date: 2006-12-26 00:00:00 -08:00
6
+ version: 1.0.2
7
+ date: 2007-01-02 00:00:00 -08:00
8
8
  summary: An elegant, structured XHTML/XML templating engine.
9
9
  require_paths:
10
10
  - lib
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ post_install_message:
28
29
  authors:
29
30
  - Hampton Catlin
30
31
  files:
@@ -61,19 +62,19 @@ files:
61
62
  - test/results/helpers.xhtml
62
63
  - test/rhtml/standard.rhtml
63
64
  - test/mocks/article.rb
64
- - test/templates/whitespace_handling.haml
65
- - test/templates/eval_suppressed.haml
66
65
  - test/templates/standard.haml
67
66
  - test/templates/helpful.haml
67
+ - test/templates/whitespace_handling.haml
68
68
  - test/templates/helpers.haml
69
- - test/templates/silent_script.haml
70
69
  - test/templates/partialize.haml
71
- - test/templates/_text_area.haml
70
+ - test/templates/eval_suppressed.haml
72
71
  - test/templates/list.haml
73
- - test/templates/partials.haml
72
+ - test/templates/_text_area.haml
74
73
  - test/templates/content_for_layout.haml
75
- - test/templates/original_engine.haml
74
+ - test/templates/partials.haml
75
+ - test/templates/silent_script.haml
76
76
  - test/templates/very_basic.haml
77
+ - test/templates/original_engine.haml
77
78
  - test/templates/_partial.haml
78
79
  - test/templates/just_stuff.haml
79
80
  - test/templates/tag_parsing.haml