From cfc80bfbe92945bb2ba16a9a75d08d1eee225a9f Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Wed, 8 May 2024 14:54:31 -0500 Subject: [PATCH] fix: Disallow as a child of --- debug/src/debug.js | 5 ++- debug/test/browser/debug.test.js | 52 ++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/debug/src/debug.js b/debug/src/debug.js index 45cc67c3e5..73c9c3dcef 100644 --- a/debug/src/debug.js +++ b/debug/src/debug.js @@ -387,11 +387,10 @@ export function initDebug() { type === 'tr' && domParentName !== 'thead' && domParentName !== 'tfoot' && - domParentName !== 'tbody' && - domParentName !== 'table' + domParentName !== 'tbody' ) { console.error( - 'Improper nesting of table. Your should have a parent.' + + 'Improper nesting of table. Your should have a parent.' + serializeVNode(vnode) + `\n\n${getOwnerStack(vnode)}` ); diff --git a/debug/test/browser/debug.test.js b/debug/test/browser/debug.test.js index cd4b4d9bd8..b88bd8cb2c 100644 --- a/debug/test/browser/debug.test.js +++ b/debug/test/browser/debug.test.js @@ -543,12 +543,14 @@ describe('debug', () => { it('Accepts minimal well formed table', () => { const Table = () => (
- - - - - - + + + + + + + +
Head
Body
Head
Body
); render(, scratch); @@ -586,23 +588,27 @@ describe('debug', () => { it('accepts valid nested tables', () => { const Table = () => (
- - - - - - - - - + + + + + + + + + + +
foo
- - - - - - -
cell1cell2cell3
-
bar
foo
+ + + + + + + + +
cell1cell2cell3
+
bar
);