File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ export function initDebug() {
370
370
// `preact-render-to-string`. There we'd otherwise flood the terminal
371
371
// with false positives, which we'd like to avoid.
372
372
let domParentName = getClosestDomNodeParentName ( parent ) ;
373
- if ( domParentName !== '' ) {
373
+ if ( domParentName !== '' && isTableElement ( type ) ) {
374
374
if (
375
375
type === 'table' &&
376
376
// Tables can be nested inside each other if it's inside a cell.
Original file line number Diff line number Diff line change @@ -662,6 +662,19 @@ describe('debug', () => {
662
662
expect ( console . error ) . to . be . calledOnce ;
663
663
} ) ;
664
664
665
+ it ( 'should warn for nesting illegal dom-nodes under a paragraph with a parent' , ( ) => {
666
+ const Paragraph = ( ) => (
667
+ < div >
668
+ < p >
669
+ < div > Hello world</ div >
670
+ </ p >
671
+ </ div >
672
+ ) ;
673
+
674
+ render ( < Paragraph /> , scratch ) ;
675
+ expect ( console . error ) . to . be . calledOnce ;
676
+ } ) ;
677
+
665
678
it ( 'should warn for nesting illegal dom-nodes under a paragraph as func' , ( ) => {
666
679
const Title = ( { children } ) => < h1 > { children } </ h1 > ;
667
680
const Paragraph = ( ) => (
You can’t perform that action at this time.
0 commit comments