You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using <li> elements inside of tags that are not <ul> the nested children get hoisted out. In the codepen I have used the custom tag <custom_list> but the same behavior occurs with standard <div> tags.
You need to stick with the rules of the HTML language. You can’t have lis in random elements.
(and if you want custom elements, use - instead of _ in the name.)
Initial checklist
Affected packages and versions
rehype-parse@9.0.0
Link to runnable example
https://codesandbox.io/p/devbox/loving-borg-9p5c5q?file=%2Fsrc%2Findex.ts%3A11%2C7
Steps to reproduce
When using
<li>
elements inside of tags that are not<ul>
the nested children get hoisted out. In the codepen I have used the custom tag<custom_list>
but the same behavior occurs with standard<div>
tags.Input:
Output:
Expected behavior
The nested list item should be maintained as child of element inside the
<li>
tagActual behavior
The child of the element inside the
<li>
tag is hoisted up 1 level.Runtime
Other (please specify in steps to reproduce)
Package manager
pnpm
OS
Linux
Build and bundle tools
Vite
The text was updated successfully, but these errors were encountered: