slim 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES CHANGED
@@ -1,5 +1,7 @@
1
1
  master
2
2
 
3
+ * Fixed html attribute issue in sections mode (#127)
4
+
3
5
  0.9.3
4
6
 
5
7
  * Allow for bypassing escaping in attributes
@@ -22,7 +22,7 @@ module Slim
22
22
  # Interpolation
23
23
  string, code = parse_expression($')
24
24
  escape = code !~ /^\{.*\}$/
25
- block << [:escape, escape, [:dynamic, escape ? code : code[1..-2]]]
25
+ block << [:slim, :output, escape, escape ? code : code[1..-2], [:multi]]
26
26
  when /^([^#]+|#)/
27
27
  # Static text
28
28
  block << [:static, $&]
data/lib/slim/sections.rb CHANGED
@@ -41,6 +41,18 @@ module Slim
41
41
  [:slim, :output, escape, access(name), content]
42
42
  end
43
43
 
44
+ def on_slim_attr(name, escape, value)
45
+ [:slim, :attr, name, escape, access(value)]
46
+ end
47
+
48
+ def on_dynamic(code)
49
+ raise 'Embedded code is forbidden in sections mode'
50
+ end
51
+
52
+ def on_code(code)
53
+ raise 'Embedded code is forbidden in sections mode'
54
+ end
55
+
44
56
  protected
45
57
 
46
58
  def on_slim_inverted_section(name, content)
data/lib/slim/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Slim
2
2
  # Slim version string
3
3
  # @api public
4
- VERSION = '0.9.3'
4
+ VERSION = '0.9.4'
5
5
  end
data/test/helper.rb CHANGED
@@ -131,6 +131,10 @@ class Env
131
131
  end
132
132
 
133
133
  class ViewEnv
134
+ def output_number
135
+ 1337
136
+ end
137
+
134
138
  def person
135
139
  [{:name => 'Joe'}, {:name => 'Jack'}]
136
140
  end
@@ -29,4 +29,11 @@ ul
29
29
  assert_html '<ul><li>Andy</li><li>Atlanta</li><li>Fred</li><li>Melbourne</li><li>Daniel</li><li>Karlsruhe</li></ul>', source, :sections => true
30
30
  end
31
31
 
32
+ def test_method
33
+ source = %q{
34
+ a href=output_number Link
35
+ }
36
+ assert_html '<a href="1337">Link</a>', source, :sections => true
37
+ end
38
+
32
39
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: slim
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.3
5
+ version: 0.9.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andrew Stone
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-05-15 00:00:00 -04:00
15
+ date: 2011-05-21 00:00:00 -04:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency