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
Nested paragraph tags not rendering on server #14409
Comments
I want to take a look at this |
Nested |
@patrick-mcdougle HTML only have certain elements that can be nested. is not one of those. Heres some information. https://stackoverflow.com/questions/9852312/list-of-html5-elements-that-can-be-nested-inside-p-element |
@patrick-mcdougle Thanks for the response and the help |
This is correct, I think the issue can be closed. |
Yeah I understand it's not correct HTML, however wouldn't it make more sense for the output to be consistent (not render anything)? |
|
This seems to be a no-fix from the Next.js side. Can you please file this upstream with the React team? This seems to be a difference between ReactDOM client and server. |
Also ran into this. Very peculiar behavior. It should just render the output, even if it isn't valid markup. Or at least provide a warning. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
I came across this "bug" when building out a website using a headless CMS. I injected my CMS content into my application via
<p dangerouslySetInnerHTML={{ __html: externalHtml }} />
, however the HTML output from the CMS also contains a nested<p
> tag.When I load the page from the server, the content does not show, when I navigate to a page via client routing, it shows.
To Reproduce
https://github.com/Ehesp/nextjs-html-rendering-issue
https://nextjs-html-rendering-issue.ehesp.vercel.app/
Expected behavior
Technically nested
p
tags are incorrect and I sorted this by adding the HTML to anarticle
tag, however since the output is different on server vs client it seems to be a bug?Screenshots
Server:
Client:
System information
The text was updated successfully, but these errors were encountered: