On 8 Mar 2008, at 19:08, Nate Vack wrote:
> What should happen here? It looks like maybe the code should generate
> <li class="bar"> and <div class="bar"> -- that would be...
> surprising... to me, as a developer. Right now with haml, I *know*
> what's gonna happen when I write '.bar'.

As Irfan Adilovic already pointed out, if you want a <div>, you can  
write %div. In some circumstances it would be monumentally useful to  
have a context-aware partial that generated the appropriate tag at the  
top level -- for rendering a representation of a particular model, for  
example, regardless of whether the partial was rendered directly into  
the <body>, into a <p>, or into a <ul>.

This behaviour shouldn't be "surprising" if you haven't specified  
which tag to output. In many ways it's the least surprising behaviour:  
"I haven't given a tag name here, so do whatever is best". Only  
familiarity with the meaning of Haml's current syntax would lead you  
to expect a <div> where none was specified; if the syntax changed,  
future developers wouldn't have the same expectation.

Cheers,
-Tom

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