Haml is giving you what you're requesting but the browser is not -- some
block elements within inline content are/used-to-be invalid which would
cause the browser to close the inline tag when they block elements are
encountered -- assuming you left off the end tag. Then when it sees the
trailing end tag with no corresponding open tag, it creates the open tag for
you again.  What you end up seeing in firebug is the document as it was
understood by the browser.

chris

On Sun, Aug 22, 2010 at 4:26 PM, Fernando Espinosa <
fernando.espin...@gmail.com> wrote:

> Hi!
>
> I'm trying to put an unordered list inside an anchor tag. I'm using a
> html5 doctype, and version 3.0.17 of haml gem.
>
> This code is failing:
>
>  %ul
>    - @pets.each do |pet|
>      %li.pet
>        %a{:href => url_for(pet)}
>          %ul
>            %li.photo
>              = image_tag('dog1.jpg')
>
> It renders an empty link tag before the ul, and another link tag
> before the image tag. It does render it well if I put it this way:
>
>  %ul
>    - @pets.each do |pet|
>      %li.pet
>        %a{:href => url_for(pet)}
>          %span
>            %ul
>              %li.photo
>                = image_tag('dog1.jpg')
>
> But the problem is the resulting html is not w3c valid. If I change
> the %span with a %div tag, it also fails as in the first case.
>
> This is the markup I'm trying to get:
>
> <ul>
>  <li class="peet">
>  <a href="/pet/1">
>   <ul>
>    <li class="photo">
>     <img src="dog1.jpg" alt="dog" />
>    </li>
>   </ul>
>  </a>
>  </li>
> </ul>
>
> Which is w3c valid.
>
> I would appreciate any help :)
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to h...@googlegroups.com.
> To unsubscribe from this group, send email to
> haml+unsubscr...@googlegroups.com <haml%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to