-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
chore: tweak html tree validation #12618
Conversation
- relax validation in some places where we know the HTML will not break or only break when using SSR - consolidate validation in one place and for better reuse, which results in more cases getting caught at runtime closes #11941
|
@@ -192,6 +192,14 @@ | |||
|
|||
> %thing% is invalid inside <%parent%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're giving enough diagnostic information here. If I saw this error message...
<tr>
is invalid inside<table>
...I would tear my hair out. I think we need some supplemental information at the very least, but it'd be better still if we just handled this case. What would it take for us to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I poked a bit at it this morning but didn't get very far - just opened a draft PR for visibility #12628
Co-authored-by: Simon H <[email protected]>
Co-authored-by: Simon H <[email protected]>
This deliberately doesn't include validation of elements that are invalid but still render without the browser adjusting the DOM in some way. I think the current validation is flexible/open enough to be enhanced to catch more cases later on like "this is only valid as the first child", if we wanted to.
closes #11941
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint