feat(core): do not wrap nested tables

This commit is contained in:
alistair3149 2023-05-01 14:44:19 -04:00
parent c10dd046c3
commit 3d14f9cf0b
No known key found for this signature in database

View file

@ -103,11 +103,12 @@ function wrapTable( table ) {
* @return {void}
*/
function init( bodyContent ) {
if ( !bodyContent.querySelector( 'table' ) ) {
// Don't touch nested tables since we only need to wrap the outer layer
if ( !bodyContent.querySelector( 'table:not( table table )' ) ) {
return;
}
const tables = bodyContent.querySelectorAll( 'table' );
const tables = bodyContent.querySelectorAll( 'table:not( table table )' );
tables.forEach( ( table ) => {
wrapTable( table );