Actually, I just tried your line: haml_tag :div, nil, :class=>'clearfloat' but I got a haml error
You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.collect vendor/gems/haml-1.9.0/lib/haml/precompiler.rb:470:in `build_attributes' vendor/gems/haml-1.9.0/lib/haml/helpers.rb:295:in `haml_tag' It's no big deal, I can go back to the other way, but if people are trying to do this with 1.9 maybe there should be an option to use an HTML self-closing tags list to check if the element should be self- closed. On Apr 11, 11:00 am, treybean <[EMAIL PROTECTED]> wrote: > Thanks Mislav. That makes sense. Yeah, if we could use true XHMTL > the world would be a nicer place. One day! > > On Apr 11, 10:41 am, "Mislav Marohnić" <[EMAIL PROTECTED]> > wrote: > > > On Fri, Apr 11, 2008 at 6:18 PM, treybean <[EMAIL PROTECTED]> wrote: > > > > If I do: > > > > haml_tag :div, :class=>'clearfloat' > > > > it generates: > > > > <div class="clearfloat"/> > > > In XHTML, this is perfectly valid, safe and legal. But, if you're serving > > your pages as text/html (which you are because IE doesn't support XHTML), > > this would be parsed like an opening tag for DIV and the tag soup parser > > will continue to search for what it thinks could be the closing tag. In most > > cases, the document would render all messed-up (depending on your CSS, > > mostly). > > > You can use this: > > > haml_tag :div, nil, :class=>'clearfloat' > > > - Mislav --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
