Hi,

I noticed a small bug which doesn't seem to be fixed in trunk ;)
The following syntax works :
%p
  == Hello #{person}
(generates : <p>Hello John</p> for person = "John")

However the following doesn't work properly :
%p== Hello #{person}
(syntax error, unexpected '=')


I wrote a small test for this issue :
Index: test/haml/engine_test.rb
===================================================================
--- test/haml/engine_test.rb    (révision 503)
+++ test/haml/engine_test.rb    (copie de travail)
@@ -53,6 +53,10 @@
     assert_equal("<strong>Hi there!</strong>\n", engine.to_html)
   end

+  def test_tag_with_double_equals
+    assert_equal("<p>Hello World</p>\n", render('%p== Hello
#{who}', :locals => {:who => 'World'}))
+  end
+
   # Options tests

   def test_stop_eval



And here is the patch that seems to fix the problem :
Index: lib/haml/engine.rb
===================================================================
--- lib/haml/engine.rb  (révision 503)
+++ lib/haml/engine.rb  (copie de travail)
@@ -580,6 +580,7 @@
           atomic = true
         when '=', '~'
           parse = true
+          value = value[1..-1].strip.dump.gsub('\\#', '#') if
value.first == '='
         end

         flattened = (action == '~')



Have a nice day !
Thomas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to