haml 3.2.0.alpha.13 → 3.2.0.alpha.14

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.

@@ -1,440 +0,0 @@
1
- module ErbTests
2
- def test_erb
3
- assert_equal '- foo = bar', render_erb('<% foo = bar %>')
4
- assert_equal '- foo = bar', render_erb('<% foo = bar -%>')
5
- assert_equal '= h @item.title', render_erb('<%=h @item.title %>')
6
- assert_equal '= h @item.title', render_erb('<%=h @item.title -%>')
7
- end
8
-
9
- def test_inline_erb
10
- assert_equal("%p= foo", render_erb("<p><%= foo %></p>"))
11
- end
12
-
13
- def test_non_inline_erb
14
- assert_equal(<<HAML.rstrip, render_erb(<<HTML))
15
- %p
16
- = foo
17
- HAML
18
- <p>
19
- <%= foo %>
20
- </p>
21
- HTML
22
- assert_equal(<<HAML.rstrip, render_erb(<<HTML))
23
- %p
24
- = foo
25
- HAML
26
- <p>
27
- <%= foo %></p>
28
- HTML
29
- assert_equal(<<HAML.rstrip, render_erb(<<HTML))
30
- %p
31
- = foo
32
- HAML
33
- <p><%= foo %>
34
- </p>
35
- HTML
36
- end
37
-
38
- def test_erb_in_cdata
39
- assert_equal(<<HAML.rstrip, render_erb(<<HTML))
40
- :cdata
41
- Foo \#{bar} baz
42
- HAML
43
- <![CDATA[Foo <%= bar %> baz]]>
44
- HTML
45
- end
46
-
47
- def test_erb_in_script
48
- assert_equal(<<HAML.rstrip, render_erb(<<HTML))
49
- :javascript
50
- function foo() {
51
- return \#{foo.to_json};
52
- }
53
- HAML
54
- <script type="text/javascript">
55
- function foo() {
56
- return <%= foo.to_json %>;
57
- }
58
- </script>
59
- HTML
60
- end
61
-
62
- def test_erb_in_style
63
- assert_equal(<<HAML.rstrip, render_erb(<<HTML))
64
- :css
65
- foo {
66
- bar: \#{"baz"};
67
- }
68
- HAML
69
- <style type="text/css">
70
- foo {
71
- bar: <%= "baz" %>;
72
- }
73
- </style>
74
- HTML
75
- end
76
-
77
- def test_erb_in_line
78
- assert_equal 'foo bar #{baz}', render_erb('foo bar <%= baz %>')
79
- assert_equal 'foo bar #{baz}! Bang.', render_erb('foo bar <%= baz %>! Bang.')
80
- end
81
-
82
- def test_erb_multi_in_line
83
- assert_equal('foo bar #{baz}! Bang #{bop}.',
84
- render_erb('foo bar <%= baz %>! Bang <%= bop %>.'))
85
- assert_equal('foo bar #{baz}#{bop}!',
86
- render_erb('foo bar <%= baz %><%= bop %>!'))
87
- end
88
-
89
- def test_erb_with_html_special_chars
90
- assert_equal '= 3 < 5 ? "OK" : "Your computer is b0rken"',
91
- render_erb('<%= 3 < 5 ? "OK" : "Your computer is b0rken" %>')
92
- end
93
-
94
- def test_erb_in_class_attribute
95
- assert_equal "%div{:class => dyna_class} I have a dynamic attribute",
96
- render_erb('<div class="<%= dyna_class %>">I have a dynamic attribute</div>')
97
- end
98
-
99
- def test_erb_in_id_attribute
100
- assert_equal "%div{:id => dyna_id} I have a dynamic attribute",
101
- render_erb('<div id="<%= dyna_id %>">I have a dynamic attribute</div>')
102
- end
103
-
104
- def test_erb_in_attribute_results_in_string_interpolation
105
- assert_equal('%div{:id => "item_#{i}"} Ruby string interpolation FTW',
106
- render_erb('<div id="item_<%= i %>">Ruby string interpolation FTW</div>'))
107
- end
108
-
109
- def test_erb_in_attribute_with_trailing_content
110
- assert_equal('%div{:class => "#{12}!"} Bang!',
111
- render_erb('<div class="<%= 12 %>!">Bang!</div>'))
112
- end
113
-
114
- def test_erb_in_html_escaped_attribute
115
- assert_equal '%div{:class => "foo"} Bang!',
116
- render_erb('<div class="<%= "foo" %>">Bang!</div>')
117
- end
118
-
119
- def test_erb_in_attribute_to_multiple_interpolations
120
- assert_equal('%div{:class => "#{12} + #{13}"} Math is super',
121
- render_erb('<div class="<%= 12 %> + <%= 13 %>">Math is super</div>'))
122
- end
123
-
124
- def test_whitespace_eating_erb_tags
125
- assert_equal '- form_for', render_erb('<%- form_for -%>')
126
- end
127
-
128
- def test_interpolation_in_erb
129
- assert_equal('= "Foo #{bar} baz"', render_erb('<%= "Foo #{bar} baz" %>'))
130
- end
131
-
132
- def test_interpolation_in_erb_attrs
133
- assert_equal('%p{:foo => "#{bar} baz"}',
134
- render_erb('<p foo="<%= "#{bar} baz" %>"></p>'))
135
- end
136
-
137
- def test_multiline_erb_silent_script
138
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
139
- .blah
140
- - foo
141
- - bar
142
- - baz
143
- %p foo
144
- HAML
145
- <div class="blah">
146
- <%
147
- foo
148
- bar
149
- baz
150
- %>
151
- <p>foo</p>
152
- </div>
153
- ERB
154
- end
155
-
156
- def test_multiline_erb_loud_script
157
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
158
- .blah
159
- = foo + |
160
- bar.baz.bang + |
161
- baz |
162
- %p foo
163
- HAML
164
- <div class="blah">
165
- <%=
166
- foo +
167
- bar.baz.bang +
168
- baz
169
- %>
170
- <p>foo</p>
171
- </div>
172
- ERB
173
- end
174
-
175
- def test_weirdly_indented_multiline_erb_loud_script
176
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
177
- .blah
178
- = foo + |
179
- bar.baz.bang + |
180
- baz |
181
- %p foo
182
- HAML
183
- <div class="blah">
184
- <%=
185
- foo +
186
- bar.baz.bang +
187
- baz
188
- %>
189
- <p>foo</p>
190
- </div>
191
- ERB
192
- end
193
-
194
- def test_two_multiline_erb_loud_scripts
195
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
196
- .blah
197
- = foo + |
198
- bar.baz.bang + |
199
- baz |
200
- -#
201
- = foo.bar do |
202
- bang |
203
- end |
204
- %p foo
205
- HAML
206
- <div class="blah">
207
- <%=
208
- foo +
209
- bar.baz.bang +
210
- baz
211
- %>
212
- <%= foo.bar do
213
- bang
214
- end %>
215
- <p>foo</p>
216
- </div>
217
- ERB
218
- end
219
-
220
- def test_multiline_then_single_line_erb_loud_scripts
221
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
222
- .blah
223
- = foo + |
224
- bar.baz.bang + |
225
- baz |
226
- = foo.bar
227
- %p foo
228
- HAML
229
- <div class="blah">
230
- <%=
231
- foo +
232
- bar.baz.bang +
233
- baz
234
- %>
235
- <%= foo.bar %>
236
- <p>foo</p>
237
- </div>
238
- ERB
239
- end
240
-
241
- def test_multiline_erb_but_really_single_line
242
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
243
- .blah
244
- = foo
245
- %p foo
246
- HAML
247
- <div class="blah">
248
- <%=
249
- foo
250
- %>
251
- <p>foo</p>
252
- </div>
253
- ERB
254
- end
255
-
256
- ### Block Parsing
257
-
258
- def test_block_parsing
259
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
260
- - foo do
261
- %p bar
262
- HAML
263
- <% foo do %>
264
- <p>bar</p>
265
- <% end %>
266
- ERB
267
- end
268
-
269
- def test_block_parsing_with_args
270
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
271
- - foo do |a, b, c|
272
- %p bar
273
- HAML
274
- <% foo do |a, b, c| %>
275
- <p>bar</p>
276
- <% end %>
277
- ERB
278
- end
279
-
280
- def test_block_parsing_with_equals
281
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
282
- = foo do
283
- %p bar
284
- HAML
285
- <%= foo do %>
286
- <p>bar</p>
287
- <% end %>
288
- ERB
289
- end
290
-
291
- def test_block_parsing_with_modified_end
292
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
293
- - foo do
294
- blah
295
- - end.bip
296
- HAML
297
- <% foo do %>
298
- blah
299
- <% end.bip %>
300
- ERB
301
- end
302
-
303
- def test_block_parsing_with_modified_end_with_block
304
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
305
- - foo do
306
- blah
307
- - end.bip do
308
- brang
309
- HAML
310
- <% foo do %>
311
- blah
312
- <% end.bip do %>
313
- brang
314
- <% end %>
315
- ERB
316
- end
317
-
318
- def test_multiline_block_opener
319
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
320
- - foo bar
321
- - baz bang
322
- - biddle do
323
- foo
324
- HAML
325
- <% foo bar
326
- baz bang
327
- biddle do %>
328
- foo
329
- <% end %>
330
- ERB
331
- end
332
-
333
- def test_if_elsif_else_parsing
334
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
335
- - if foo
336
- %p bar
337
- - elsif bar.foo("zip")
338
- #bang baz
339
- - else
340
- %strong bibble
341
- HAML
342
- <% if foo %>
343
- <p>bar</p>
344
- <% elsif bar.foo("zip") %>
345
- <div id="bang">baz</div>
346
- <% else %>
347
- <strong>bibble</strong>
348
- <% end %>
349
- ERB
350
- end
351
-
352
- def test_case_when_parsing
353
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
354
- - case foo.bar
355
- - when "bip"
356
- %p bip
357
- - when "bop"
358
- %p BOP
359
- - when bizzle.bang.boop.blip
360
- %em BIZZLE BANG BOOP BLIP
361
- HAML
362
- <% case foo.bar %>
363
- <% when "bip" %>
364
- <p>bip</p>
365
- <% when "bop" %>
366
- <p>BOP</p>
367
- <% when bizzle.bang.boop.blip %>
368
- <em>BIZZLE BANG BOOP BLIP</em>
369
- <% end %>
370
- ERB
371
-
372
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
373
- - case foo.bar
374
- - when "bip"
375
- %p bip
376
- - when "bop"
377
- %p BOP
378
- - when bizzle.bang.boop.blip
379
- %em BIZZLE BANG BOOP BLIP
380
- HAML
381
- <% case foo.bar
382
- when "bip" %>
383
- <p>bip</p>
384
- <% when "bop" %>
385
- <p>BOP</p>
386
- <% when bizzle.bang.boop.blip %>
387
- <em>BIZZLE BANG BOOP BLIP</em>
388
- <% end %>
389
- ERB
390
- end
391
-
392
- def test_begin_rescue_ensure
393
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
394
- - begin
395
- %p a
396
- - rescue FooException => e
397
- %p b
398
- - ensure
399
- %p c
400
- HAML
401
- <% begin %>
402
- <p>a</p>
403
- <% rescue FooException => e %>
404
- <p>b</p>
405
- <% ensure %>
406
- <p>c</p>
407
- <% end %>
408
- ERB
409
- end
410
-
411
- # Regression
412
-
413
- def test_tag_inside_block
414
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
415
- %table
416
- - foo.each do
417
- %tr
418
- HAML
419
- <table>
420
- <% foo.each do %>
421
- <tr></tr>
422
- <% end %>
423
- </table>
424
- ERB
425
- end
426
-
427
- def test_silent_inside_block_inside_tag
428
- assert_equal(<<HAML.rstrip, render_erb(<<ERB))
429
- %table
430
- - foo.each do
431
- - haml_puts "foo"
432
- HAML
433
- <table>
434
- <% foo.each do %>
435
- <% haml_puts "foo" %>
436
- <% end %>
437
- </table>
438
- ERB
439
- end
440
- end
@@ -1,342 +0,0 @@
1
- require 'test_helper'
2
- require 'html2haml/erb_tests'
3
- require 'haml/html'
4
-
5
- class Html2HamlTest < MiniTest::Unit::TestCase
6
- def test_empty_render_should_remain_empty
7
- assert_equal '', render('')
8
- end
9
-
10
- def test_doctype
11
- assert_equal '!!!', render("<!DOCTYPE html>")
12
- assert_equal '!!! 1.1', render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">')
13
- assert_equal '!!! Strict', render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">')
14
- assert_equal '!!! Frameset', render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">')
15
- assert_equal '!!! Mobile 1.2', render('<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">')
16
- assert_equal '!!! Basic 1.1', render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">')
17
- assert_equal '!!!', render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">')
18
- assert_equal '!!! Strict', render('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">')
19
- assert_equal '!!! Frameset', render('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">')
20
- assert_equal '!!!', render('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">')
21
- end
22
-
23
- def test_id_and_class_should_be_removed_from_hash
24
- assert_equal '%span#foo.bar', render('<span id="foo" class="bar"> </span>')
25
- end
26
-
27
- def test_no_tag_name_for_div_if_class_or_id_is_present
28
- assert_equal '#foo', render('<div id="foo"> </div>')
29
- assert_equal '.foo', render('<div class="foo"> </div>')
30
- end
31
-
32
- def test_multiple_class_names
33
- assert_equal '.foo.bar.baz', render('<div class=" foo bar baz "> </div>')
34
- end
35
-
36
- def test_should_have_pretty_attributes
37
- assert_equal('%input{:name => "login", :type => "text"}/',
38
- render('<input type="text" name="login" />'))
39
- assert_equal('%meta{:content => "text/html", "http-equiv" => "Content-Type"}/',
40
- render('<meta http-equiv="Content-Type" content="text/html" />'))
41
- end
42
-
43
- def test_should_have_html_style_attributes
44
- assert_equal('%input(name="login" type="text")/',
45
- render('<input type="text" name="login" />', :html_style_attributes => true))
46
- assert_equal('%meta(content="text/html" http-equiv="Content-Type")/',
47
- render('<meta http-equiv="Content-Type" content="text/html" />', :html_style_attributes => true))
48
- end
49
-
50
- def test_class_with_dot_and_hash
51
- assert_equal('%div{:class => "foo.bar"}', render("<div class='foo.bar'></div>"))
52
- assert_equal('%div{:class => "foo#bar"}', render("<div class='foo#bar'></div>"))
53
- assert_equal('.foo.bar{:class => "foo#bar foo.bar"}', render("<div class='foo foo#bar bar foo.bar'></div>"))
54
- end
55
-
56
- def test_id_with_dot_and_hash
57
- assert_equal('%div{:id => "foo.bar"}', render("<div id='foo.bar'></div>"))
58
- assert_equal('%div{:id => "foo#bar"}', render("<div id='foo#bar'></div>"))
59
- end
60
-
61
- def test_interpolation
62
- assert_equal('Foo \#{bar} baz', render('Foo #{bar} baz'))
63
- end
64
-
65
- def test_interpolation_in_attrs
66
- assert_equal('%p{:foo => "\#{bar} baz"}', render('<p foo="#{bar} baz"></p>'))
67
- end
68
-
69
- def test_cdata
70
- assert_equal(<<HAML.strip, render(<<HTML))
71
- %p
72
- :cdata
73
- <a foo="bar" baz="bang">
74
- <div id="foo">flop</div>
75
- </a>
76
- HAML
77
- <p><![CDATA[
78
- <a foo="bar" baz="bang">
79
- <div id="foo">flop</div>
80
- </a>
81
- ]]></p>
82
- HTML
83
- end
84
-
85
- def test_self_closing_tag
86
- assert_equal("%foo/", render("<foo />"))
87
- end
88
-
89
- def test_inline_text
90
- assert_equal("%p foo", render("<p>foo</p>"))
91
- end
92
-
93
- def test_inline_comment
94
- assert_equal("/ foo", render("<!-- foo -->"))
95
- assert_equal(<<HAML.strip, render(<<HTML))
96
- / foo
97
- %p bar
98
- HAML
99
- <!-- foo -->
100
- <p>bar</p>
101
- HTML
102
- end
103
-
104
- def test_non_inline_comment
105
- assert_equal(<<HAML.rstrip, render(<<HTML))
106
- /
107
- Foo
108
- Bar
109
- HAML
110
- <!-- Foo
111
- Bar -->
112
- HTML
113
- end
114
-
115
- def test_non_inline_text
116
- assert_equal(<<HAML.rstrip, render(<<HTML))
117
- %p
118
- foo
119
- HAML
120
- <p>
121
- foo
122
- </p>
123
- HTML
124
- assert_equal(<<HAML.rstrip, render(<<HTML))
125
- %p
126
- foo
127
- HAML
128
- <p>
129
- foo</p>
130
- HTML
131
- assert_equal(<<HAML.rstrip, render(<<HTML))
132
- %p
133
- foo
134
- HAML
135
- <p>foo
136
- </p>
137
- HTML
138
- end
139
-
140
- def test_script_tag
141
- assert_equal(<<HAML.rstrip, render(<<HTML))
142
- :javascript
143
- function foo() {
144
- return "12" & "13";
145
- }
146
- HAML
147
- <script type="text/javascript">
148
- function foo() {
149
- return "12" &amp; "13";
150
- }
151
- </script>
152
- HTML
153
- end
154
-
155
- def test_script_tag_with_cdata
156
- assert_equal(<<HAML.rstrip, render(<<HTML))
157
- :javascript
158
- function foo() {
159
- return "&amp;";
160
- }
161
- HAML
162
- <script type="text/javascript">
163
- <![CDATA[
164
- function foo() {
165
- return "&amp;";
166
- }
167
- ]]>
168
- </script>
169
- HTML
170
- end
171
-
172
- def test_pre
173
- assert_equal(<<HAML.rstrip, render(<<HTML))
174
- %pre
175
- :preserve
176
- foo
177
- bar
178
- baz
179
- HAML
180
- <pre>foo
181
- bar
182
- baz</pre>
183
- HTML
184
- end
185
-
186
- def test_pre_code
187
- assert_equal(<<HAML.rstrip, render(<<HTML))
188
- %pre
189
- %code
190
- :preserve
191
- foo
192
- bar
193
- baz
194
- HAML
195
- <pre><code>foo
196
- bar
197
- baz</code></pre>
198
- HTML
199
- end
200
-
201
- def test_code_without_pre
202
- assert_equal(<<HAML.rstrip, render(<<HTML))
203
- %code
204
- foo
205
- bar
206
- baz
207
- HAML
208
- <code>foo
209
- bar
210
- baz</code>
211
- HTML
212
- end
213
-
214
- def test_conditional_comment
215
- assert_equal(<<HAML.rstrip, render(<<HTML))
216
- /[if foo]
217
- bar
218
- baz
219
- HAML
220
- <!--[if foo]>
221
- bar
222
- baz
223
- <![endif]-->
224
- HTML
225
- end
226
-
227
- def test_style_to_css_filter
228
- assert_equal(<<HAML.rstrip, render(<<HTML))
229
- :css
230
- foo {
231
- bar: baz;
232
- }
233
- HAML
234
- <style type="text/css">
235
- foo {
236
- bar: baz;
237
- }
238
- </style>
239
- HTML
240
- end
241
-
242
- def test_inline_conditional_comment
243
- assert_equal(<<HAML.rstrip, render(<<HTML))
244
- /[if foo] bar baz
245
- HAML
246
- <!--[if foo]> bar baz <![endif]-->
247
- HTML
248
- end
249
-
250
- def test_minus_in_tag
251
- assert_equal("%p - foo bar -", render("<p>- foo bar -</p>"))
252
- end
253
-
254
- def test_equals_in_tag
255
- assert_equal("%p = foo bar =", render("<p>= foo bar =</p>"))
256
- end
257
-
258
- def test_hash_in_tag
259
- assert_equal("%p # foo bar #", render("<p># foo bar #</p>"))
260
- end
261
-
262
- def test_comma_post_tag
263
- assert_equal(<<HAML.rstrip, render(<<HTML))
264
- #foo
265
- %span> Foo
266
- ,
267
- %span bar
268
- Foo
269
- %span> bar
270
- ,
271
- %span baz
272
- HAML
273
- <div id="foo">
274
- <span>Foo</span>, <span>bar</span>
275
- Foo<span>bar</span>, <span>baz</span>
276
- </div>
277
- HTML
278
- end
279
-
280
- def test_comma_post_tag_with_text_before
281
- assert_equal(<<HAML.rstrip, render(<<HTML))
282
- #foo
283
- Batch
284
- = succeed "," do
285
- %span Foo
286
- %span Bar
287
- HAML
288
- <div id="foo">
289
- Batch
290
- <span>Foo</span>, <span>Bar</span>
291
- </div>
292
- HTML
293
- end
294
-
295
- begin
296
- require 'haml/html/erb'
297
- include ErbTests
298
- rescue LoadError => e
299
- puts "\n** Couldn't require #{e.message[/-- (.*)$/, 1]}, skipping some tests"
300
- end
301
-
302
- # Encodings
303
-
304
- unless RUBY_VERSION < "1.9"
305
- def test_encoding_error
306
- render("foo\nbar\nb\xFEaz".force_encoding("utf-8"))
307
- assert(false, "Expected exception")
308
- rescue Haml::Error => e
309
- assert_equal(3, e.line)
310
- assert_equal('Invalid UTF-8 character "\xFE"', e.message)
311
- end
312
-
313
- def test_ascii_incompatible_encoding_error
314
- template = "foo\nbar\nb_z".encode("utf-16le")
315
- template[9] = "\xFE".force_encoding("utf-16le")
316
- render(template)
317
- assert(false, "Expected exception")
318
- rescue Haml::Error => e
319
- assert_equal(3, e.line)
320
- assert_equal('Invalid UTF-16LE character "\xFE"', e.message)
321
- end
322
- end
323
-
324
- # Regression Tests
325
-
326
- def test_xhtml_strict_doctype
327
- assert_equal('!!! Strict', render(<<HTML))
328
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
329
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
330
- HTML
331
- end
332
-
333
- protected
334
-
335
- def render(text, options = {})
336
- Haml::HTML.new(text, options).render.rstrip
337
- end
338
-
339
- def render_erb(text)
340
- render(text, :erb => true)
341
- end
342
- end