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 +1 -1
- data/lib/haml/engine.rb +27 -21
- data/test/results/just_stuff.xhtml +1 -0
- data/test/results/whitespace_handling.xhtml +1 -1
- data/test/templates/just_stuff.haml +3 -0
- metadata +10 -9
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/haml/engine.rb
CHANGED
@@ -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
|
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
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
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
|
@@ -36,7 +36,7 @@
|
|
36
36
|
<pre>
 ___
 ,o88888
 ,o8888888'
 ,:o:o:oooo. ,8O88Pd8888"
 ,.::.::o:ooooOoOoO. ,oO8O8Pd888'"
 ,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"
 , ..:.::o:ooOoOOOO8OOOOo.FdO8O8"
 , ..:.::o:ooOoOO8O888O8O,COCOO"
 , . ..:.::o:ooOoOOOO8OOOOCOCO"
 . ..:.::o:ooOoOoOO8O8OCCCC"o
 . ..:.::o:ooooOoCoCCC"o:o
 . ..:.::o:o:,cooooCo"oo:o:
 ` . . ..:.:cocoooo"'o:o:::'
 .` . ..::ccccoc"'o:o:o:::'
 :.:. ,c:cccc"':.:.:.:.:.'
 ..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/
 ...:.'.:.::::"' . . . . .'
 .. . ....:."' ` . . . ''
 . . . ...."'
 .. . ."' -hrr-
 .


 It's a planet!
%strong This shouldn't be bold!
</pre>
|
37
37
|
<strong>This should!</strong>
|
38
38
|
<textarea>
|
39
|
-
___ ___ ___ ___
 /\__\ /\ \ /\__\ /\__\
 /:/ / /::\ \ /::| | /:/ /
 /:/__/ /:/\:\ \ /:|:| | /:/ /
 /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ /
 /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/
 \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \
 \::/ / \::/ / /:/ / \:\ \
 /:/ / /:/ / /:/ / \:\ \
 /:/ / /:/ / /:/ / \:\__\
 \/__/ \/__/ \/__/ \/__/

|
39
|
+
___ ___ ___ ___
 /\__\ /\ \ /\__\ /\__\
 /:/ / /::\ \ /::| | /:/ /
 /:/__/ /:/\:\ \ /:|:| | /:/ /
 /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ /
 /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/
 \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \
 \::/ / \::/ / /:/ / \:\ \
 /:/ / /:/ / /:/ / \:\ \
 /:/ / /:/ / /:/ / \:\__\
 \/__/ \/__/ \/__/ \/__/

 Many
 thanks
 to
 http://www.network-science.de/ascii/

|
40
40
|
<strong>indeed!</strong>
|
41
41
|
</textarea>
|
42
42
|
</div>
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
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.
|
7
|
-
date:
|
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/
|
70
|
+
- test/templates/eval_suppressed.haml
|
72
71
|
- test/templates/list.haml
|
73
|
-
- test/templates/
|
72
|
+
- test/templates/_text_area.haml
|
74
73
|
- test/templates/content_for_layout.haml
|
75
|
-
- test/templates/
|
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
|