public
Rubygem
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/chriseppstein/haml.git
Literal attribute parsing error fixed. Thanks to smok for pointing this 
out.


git-svn-id: svn://hamptoncatlin.com/haml/tags/stable@592 
7063305b-7217-0410-af8c-cdc13e5119b9
nex3 (author)
Tue Aug 21 18:42:19 -0700 2007
commit  6888c0f9edbd9df4fa01eb8e27f8f88ee34903a2
tree    6c995bf27004116847b8e0cabc4d7f25155b644f
parent  03bd467a5151060a3e329aa28933a40e00c79bf5
...
100
101
102
103
 
104
105
106
...
100
101
102
 
103
104
105
106
0
@@ -100,7 +100,7 @@ module Haml
0
     TAG_REGEX = /[%]([-:\w]+)([-\w\.\#]*)(\{.*\})?(\[.*\])?([=\/\~]?)?(.*)?/
0
 
0
     # The Regex that matches a literal string or symbol value
0
- LITERAL_VALUE_REGEX = /^\s*(:(\w*)|(('|")([^\\\#]*?)\4))\s*$/
0
+ LITERAL_VALUE_REGEX = /^\s*(:(\w*)|(('|")([^\\\#'"]*?)\4))\s*$/
0
 
0
     FLAT_WARNING = <<END
0
 Haml deprecation warning:
...
114
115
116
 
 
 
 
 
117
118
119
...
114
115
116
117
118
119
120
121
122
123
124
0
@@ -114,6 +114,11 @@ class EngineTest < Test::Unit::TestCase
0
     assert_equal("NOT RECOMPILED\n", render(template, :locals => { :text => "first time" }))
0
     assert_equal("<p>first time</p>\n", render(template, :locals => { :text => "first time", :foo => 'bar' }))
0
   end
0
+
0
+ def test_dynamc_attrs_shouldnt_register_as_literal_values
0
+ assert_equal("<p a='b2c'>\n</p>\n", render('%p{:a => "b#{1 + 1}c"}'))
0
+ assert_equal("<p a='b2c'>\n</p>\n", render("%p{:a => 'b' + (1 + 1).to_s + 'c'}"))
0
+ end
0
     
0
   def test_comps
0
     assert_equal(-1, "foo" <=> nil)

Comments

    No one has commented yet.