-
Notifications
You must be signed in to change notification settings - Fork 4
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
Validate nesting of DOM nodes #14
Labels
enhancement
New feature or request
Comments
aalin
added a commit
that referenced
this issue
Sep 29, 2022
This is how React does it: https://reactjs.org/docs/forms.html#the-select-tag Related to #14 because it's doing some validation too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Browsers accept invalid HTML and rearranges things into valid HTML.
So:
will turn into:
This will make Mayu confused because there is a tbody where there should be a tr...
Something like this maybe:
https://github.com/facebook/react/blob/97d75c9c8bcddb0daed1ed062101c7f5e9b825f4/packages/react-dom-bindings/src/client/validateDOMNesting.js
This should be configurable so that it can be disabled in production mode.
Update: If #20 gets implemented with Nokogiri, then, I think that Nokogiri will make sure elements are wrapped correctly. The errors from Nokogiri could be logged, but the server side DOM will at least be valid, so that it will always be in sync with the browser DOM.
The text was updated successfully, but these errors were encountered: