deedubs / require-jade

Add jade to requireJS
MIT License
55 stars 17 forks source link

Wrong HTML produced when using address tag #27

Closed binarykitchen closed 10 years ago

binarykitchen commented 10 years ago

In my jade file I have this:

        p.byline
            address.author by
                a(rel="author", href="/user/john-doe") John Doe
            time(pubdate) 5/12/2013

But the generated HTML code looks wrong:

<p class="byline"></p>
<address class="author">by<a rel="author" href="/user/john-doe">John Doe</a></address>
<time pubdate="pubdate">5/12/2013</time>

but I am expecting this:

<p class="byline">
  <address class="author">by<a rel="author" href="/user/john-doe">John Doe</a></address>
  <time pubdate="pubdate">5/12/2013</time>
</p>

It looks like the address tag closes the parent tag too early. When I replace the address tag with span.address, then it works.

A bug?

crissdev commented 10 years ago

@binarykitchen Use a DIV instead of a P. P only supports inline elements, and address is a block level element. Here's a fiddle on this. If you replace the P with a DIV you'll get what you expected. Use the DOM inspector to understand more.

binarykitchen commented 10 years ago

Oh man, thx. Suprised to learn that after 15 years of hardcore HTML + CSS, grins ...