capricorn86 / happy-dom

A JavaScript implementation of a web browser without its graphical user interface
MIT License
3.24k stars 194 forks source link

fix: [#1039] Allow nested list items #1303

Closed danbentley closed 5 months ago

danbentley commented 5 months ago

When given the markup:

</body>
<ul>
 <li>Parent Item
    <ul>
      <li>Child Item 1</li>
      <li>Child Item 2</li>
    </ul>
 </li>
 <li>Another Parent Item</li>
</ul>
</body>

Happy DOM produces:

<body>
<ul>
 <li>Parent Item
    <ul>
      </ul></li><li>Child Item 1</li>
      <li>Child Item 2</li>
    </ul>

 <li>Another Parent Item</li>

</body>

Because <li> is treated as an unnestable element. I've removed LI from the list of unnestable elements and updated the tests to reflect this change.

capricorn86 commented 5 months ago

I'm closing this as it was fixed in #1304