New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Root node is replaced by a div
when a custom div
is in options.components
#36
Comments
Yep. See: Line 61 in f37d25d
How is it a problem though? |
I expected the source HTML and result HTML to be the same. It looks like a side-effect to me. After all, a wrapping element is being implicitly created that shouldn't exist. Maybe there should be a I was surprised to see that the root node gets passed to |
The |
I get it’s unexpected, just not sure how to do anything about it |
Initial checklist
Affected packages and versions
rehype-react@latest
Link to runnable example
https://codesandbox.io/s/rehype-react-bug-szj7g
Steps to reproduce
I have included a link (you may have to reload the browser page).
If we comment out line 28, the extra
div
will disappear.Note that there are no
div
elements in the source HTML.Expected behavior
The
div
element should not be created.Actual behavior
The
div
element is created.Runtime
Node v16
Package manager
npm v7
OS
Windows
Build and bundle tools
Parcel, Next.js
The text was updated successfully, but these errors were encountered: