haml 3.1.5 → 3.1.6.rc.1

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/REVISION CHANGED
@@ -1 +1 @@
1
- 9a5743d5002ab63dc5e22f52a0b07ff0a0493d20
1
+ f211a9b4cf24d39942caa8e5e10c72f30276d5a7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.5
1
+ 3.1.6.rc.1
@@ -97,6 +97,8 @@ module Haml
97
97
  # The number of tabs that Engine thinks we should have
98
98
  # @real_tabs + @tabulation is the number of tabs actually output
99
99
  @real_tabs = 0
100
+
101
+ @preserve_pattern = /<[\s]*#{@options[:preserve].join("|")}/i
100
102
  end
101
103
 
102
104
  # Appends text to the buffer, properly tabulated.
@@ -157,7 +159,9 @@ module Haml
157
159
  return result
158
160
  <% else %>
159
161
 
160
- has_newline = result.include?("\\n")
162
+ return result if self.instance_variable_get(:@preserve_pattern).match(result)
163
+
164
+ has_newline = result.include?("\\n")
161
165
  <% if in_tag && !nuke_inner_whitespace %>
162
166
  <% unless preserve_tag %> if !has_newline <% end %>
163
167
  @real_tabs -= 1
@@ -1,3 +1,5 @@
1
+ require "abstract_controller/rendering"
2
+
1
3
  # Rails 3.2.3's form helpers add a newline after opening textareas, which can
2
4
  # cause problems with newlines being considered content rather than markup.
3
5
  # These changes fix the issue by making the helpers emit "<haml:newline/>"
@@ -8,42 +10,32 @@
8
10
  # compatibility with the latest version of Rails, made at a moment when the Haml
9
11
  # project is transitioning to a new maintainer.
10
12
 
11
- module AbstractController
12
- module Rendering
13
- def render_to_body_with_haml(options = {})
14
- if rendered = render_to_body_without_haml(options)
15
- rendered.gsub('<haml:newline/>', "\n").html_safe
16
- end
17
- end
18
- alias_method_chain :render_to_body, :haml
19
- end
20
- end
13
+ # module AbstractController
14
+ # module Rendering
15
+ # def render_to_body_with_haml(options = {})
16
+ # if rendered = render_to_body_without_haml(options)
17
+ # rendered.gsub('<haml:newline/>', "\n").html_safe
18
+ # end
19
+ # end
20
+ # alias_method_chain :render_to_body, :haml
21
+ # end
22
+ # end
21
23
 
22
24
  module ActionView
25
+ module Helpers
23
26
 
24
- class Renderer
25
- def render_template_with_haml(context, options)
26
- if rendered = render_template_without_haml(context, options)
27
- rendered.gsub('<haml:newline/>', "\n").html_safe
27
+ module FormTagHelper
28
+ def text_area_tag_with_haml(*args)
29
+ text_area_tag_without_haml(*args).sub('>&#x000A;', ">\n").html_safe
28
30
  end
31
+ alias_method_chain :text_area_tag, :haml
29
32
  end
30
- alias_method_chain :render_template, :haml
31
- end
32
-
33
- module Helpers
34
- module TagHelper
35
- private
36
33
 
37
- def content_tag_string_with_haml(name, content, options, escape = true)
38
- if name.to_sym == :textarea
39
- tag_options = tag_options(options, escape) if options
40
- content = ERB::Util.h(content) if escape
41
- "<#{name}#{tag_options}><haml:newline/>#{content}</#{name}>".html_safe
42
- else
43
- content_tag_string_without_haml(name, content, options, escape)
44
- end
34
+ module FormHelper
35
+ def text_area_with_haml(*args)
36
+ text_area_without_haml(*args).sub('>&#x000A;', ">\n").html_safe
45
37
  end
46
- alias_method_chain :content_tag_string, :haml
38
+ alias_method_chain :text_area, :haml
47
39
  end
48
40
  end
49
41
  end
@@ -1,28 +1,26 @@
1
1
  <div id='whitespace_test'>
2
2
  <div class='text_area_test_area'>
3
- <textarea>Oneline</textarea>
4
- </div>
5
- <textarea>BLAH
6
- </textarea>
3
+ <textarea>Oneline</textarea>
4
+ </div>
5
+ <textarea>BLAH
6
+ </textarea>
7
7
  <div class='text_area_test_area'>
8
- <textarea>Two&#x000A;lines</textarea>
9
- </div>
10
- <textarea>BLAH
11
- </textarea>
8
+ <textarea>Two&#x000A;lines</textarea>
9
+ </div>
10
+ <textarea>BLAH
11
+ </textarea>
12
12
  <div class='text_area_test_area'>
13
- <textarea>Oneline</textarea>
14
- </div>
15
- <textarea>BLAH</textarea>
13
+ <textarea>Oneline</textarea>
14
+ </div>
15
+ <textarea>BLAH</textarea>
16
16
  <div class='text_area_test_area'>
17
- <textarea>Two&#x000A;lines</textarea>
18
- </div>
19
- <textarea>BLAH</textarea>
20
- <div id='flattened'>
21
- <div class='text_area_test_area'>
22
- <textarea>Two&#x000A;lines</textarea>
23
- </div>
24
- <textarea>BLAH</textarea>
25
- </div>
17
+ <textarea>Two&#x000A;lines</textarea>
18
+ </div>
19
+ <textarea>BLAH</textarea>
20
+ <div id='flattened'><div class='text_area_test_area'>
21
+ <textarea>Two&#x000A;lines</textarea>
22
+ </div>
23
+ <textarea>BLAH</textarea></div>
26
24
  </div>
27
25
  <div class='hithere'>
28
26
  Foo bar
@@ -30,42 +28,40 @@
30
28
  <pre>foo&#x000A;bar</pre>
31
29
  <p><pre>foo&#x000A;bar</pre></p>
32
30
  <p>
33
- foo
34
- bar
35
- </p>
31
+ foo
32
+ bar
33
+ </p>
36
34
  </div>
37
35
  <div class='foo'>
38
36
  13
39
- <textarea>
40
- a
41
- </textarea>
37
+ <textarea>
38
+ a
39
+ </textarea>
42
40
  <textarea>&#x000A;a</textarea>
43
41
  </div>
44
42
  <div id='whitespace_test'>
45
43
  <div class='text_area_test_area'>
46
- <textarea>Oneline</textarea>
47
- </div>
48
- <textarea>BLAH
49
- </textarea>
44
+ <textarea>Oneline</textarea>
45
+ </div>
46
+ <textarea>BLAH
47
+ </textarea>
50
48
  <div class='text_area_test_area'>
51
- <textarea>Two&#x000A;lines</textarea>
52
- </div>
53
- <textarea>BLAH
54
- </textarea>
49
+ <textarea>Two&#x000A;lines</textarea>
50
+ </div>
51
+ <textarea>BLAH
52
+ </textarea>
55
53
  <div class='text_area_test_area'>
56
- <textarea>Oneline</textarea>
57
- </div>
58
- <textarea>BLAH</textarea>
54
+ <textarea>Oneline</textarea>
55
+ </div>
56
+ <textarea>BLAH</textarea>
59
57
  <div class='text_area_test_area'>
60
- <textarea>Two&#x000A;lines</textarea>
61
- </div>
62
- <textarea>BLAH</textarea>
63
- <div id='flattened'>
64
- <div class='text_area_test_area'>
65
- <textarea>Two&#x000A;lines</textarea>
66
- </div>
67
- <textarea>BLAH</textarea>
68
- </div>
58
+ <textarea>Two&#x000A;lines</textarea>
59
+ </div>
60
+ <textarea>BLAH</textarea>
61
+ <div id='flattened'><div class='text_area_test_area'>
62
+ <textarea>Two&#x000A;lines</textarea>
63
+ </div>
64
+ <textarea>BLAH</textarea></div>
69
65
  </div>
70
66
  <div class='hithere'>
71
67
  Foo bar
@@ -73,9 +69,9 @@
73
69
  <pre>foo&#x000A;bar</pre>
74
70
  <p><pre>foo&#x000A;bar</pre></p>
75
71
  <p>
76
- foo
77
- bar
78
- </p>
72
+ foo
73
+ bar
74
+ </p>
79
75
  <pre> ___&#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!</pre>
80
76
  <strong>This should!</strong>
81
77
  <textarea> ___ ___ ___ ___ &#x000A; /\__\ /\ \ /\__\ /\__\&#x000A; /:/ / /::\ \ /::| | /:/ /&#x000A; /:/__/ /:/\:\ \ /:|:| | /:/ / &#x000A; /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ / &#x000A; /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/ &#x000A; \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \ &#x000A; \::/ / \::/ / /:/ / \:\ \ &#x000A; /:/ / /:/ / /:/ / \:\ \ &#x000A; /:/ / /:/ / /:/ / \:\__\&#x000A; \/__/ \/__/ \/__/ \/__/&#x000A; &#x000A; Many&#x000A; thanks&#x000A; to&#x000A; http://www.network-science.de/ascii/
@@ -86,4 +82,4 @@
86
82
  </div>
87
83
  <pre> __ ______ __ ______&#x000A;.----.| |--.|__ |.----.| |--..--------.| __ |&#x000A;| __|| ||__ || __|| < | || __ |&#x000A;|____||__|__||______||____||__|__||__|__|__||______|</pre>
88
84
  <pre>foo
89
- bar</pre>
85
+ bar</pre>
metadata CHANGED
@@ -1,68 +1,65 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: haml
3
- version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease:
6
- segments:
7
- - 3
8
- - 1
9
- - 5
10
- version: 3.1.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.1.6.rc.1
5
+ prerelease: 6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Nathan Weizenbaum
14
9
  - Hampton Catlin
15
10
  - Norman Clarke
16
11
  autorequire:
17
12
  bindir: bin
18
13
  cert_chain: []
19
-
20
- date: 2012-05-07 00:00:00 Z
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
14
+ date: 2012-05-14 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
23
17
  name: yard
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
26
19
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 13
31
- segments:
32
- - 0
33
- - 5
34
- - 3
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
35
23
  version: 0.5.3
36
24
  type: :development
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: maruku
40
25
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: 0.5.3
32
+ - !ruby/object:Gem::Dependency
33
+ name: maruku
34
+ requirement: !ruby/object:Gem::Requirement
42
35
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 25
47
- segments:
48
- - 0
49
- - 5
50
- - 9
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
51
39
  version: 0.5.9
52
40
  type: :development
53
- version_requirements: *id002
54
- description: " Haml (HTML Abstraction Markup Language) is a layer on top of XHTML or XML\n that's designed to express the structure of XHTML or XML documents\n in a non-repetitive, elegant, easy way,\n using indentation rather than closing tags\n and allowing Ruby to be embedded with ease.\n It was originally envisioned as a plugin for Ruby on Rails,\n but it can function as a stand-alone templating engine.\n"
55
- email:
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.5.9
48
+ description: ! " Haml (HTML Abstraction Markup Language) is a layer on top of
49
+ XHTML or XML\n that's designed to express the structure of XHTML or XML documents\n
50
+ \ in a non-repetitive, elegant, easy way,\n using indentation rather than
51
+ closing tags\n and allowing Ruby to be embedded with ease.\n It was originally
52
+ envisioned as a plugin for Ruby on Rails,\n but it can function as a stand-alone
53
+ templating engine.\n"
54
+ email:
56
55
  - haml@googlegroups.com
57
56
  - norman@njclarke.com
58
- executables:
57
+ executables:
59
58
  - haml
60
59
  - html2haml
61
60
  extensions: []
62
-
63
61
  extra_rdoc_files: []
64
-
65
- files:
62
+ files:
66
63
  - rails/init.rb
67
64
  - lib/haml/buffer.rb
68
65
  - lib/haml/compiler.rb
@@ -455,38 +452,29 @@ files:
455
452
  - VERSION_NAME
456
453
  homepage: http://haml.info/
457
454
  licenses: []
458
-
459
455
  post_install_message:
460
456
  rdoc_options: []
461
-
462
- require_paths:
457
+ require_paths:
463
458
  - lib
464
- required_ruby_version: !ruby/object:Gem::Requirement
459
+ required_ruby_version: !ruby/object:Gem::Requirement
465
460
  none: false
466
- requirements:
467
- - - ">="
468
- - !ruby/object:Gem::Version
469
- hash: 3
470
- segments:
471
- - 0
472
- version: "0"
473
- required_rubygems_version: !ruby/object:Gem::Requirement
461
+ requirements:
462
+ - - ! '>='
463
+ - !ruby/object:Gem::Version
464
+ version: '0'
465
+ required_rubygems_version: !ruby/object:Gem::Requirement
474
466
  none: false
475
- requirements:
476
- - - ">="
477
- - !ruby/object:Gem::Version
478
- hash: 3
479
- segments:
480
- - 0
481
- version: "0"
467
+ requirements:
468
+ - - ! '>'
469
+ - !ruby/object:Gem::Version
470
+ version: 1.3.1
482
471
  requirements: []
483
-
484
472
  rubyforge_project: haml
485
473
  rubygems_version: 1.8.24
486
474
  signing_key:
487
475
  specification_version: 3
488
476
  summary: An elegant, structured XHTML/XML templating engine.
489
- test_files:
477
+ test_files:
490
478
  - test/haml/engine_test.rb
491
479
  - test/haml/helper_test.rb
492
480
  - test/haml/html2haml_test.rb