> The issue is that the regular expression can't balance "{", so it  
> tries
> to make the attributes hash out of everything between the first "{"  
> and
> the last "}". Thus, if you do something like %td{:colspan => "2"}=
> h("Invoice #{invoice.remote_number}") it tries to make an attribute  
> hash
> out of {:colspan => "2"}= h("Invoice #{invoice.remote_number},  
> which of
> course fails. I'm not sure why it wasn't failing for you; try this
> simpler example:
>
> %p{:foo => 'bar'} {}
>
> This is something we plan to fix before 2.0.

without having tested it - can't you just make the regexp non-greedy?

     # The Regex that matches an HTML tag command.
     TAG_REGEX = /[%]([-:\w]+)([-\w\.\#]*)(\{.*?\})?(\[.*\])?([=\/ 
\~]?)?(.*)?/

(note the added ? after .* in the hash part of the regexp


cheers jc

--~--~---------~--~----~------------~-------~--~----~
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