diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index dc00f303b18..a2f55ccd6e5 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -693,7 +693,7 @@ function formatTables($editable) { } // Ensure a tbody in every table and cancel its default style. for (const table of $editable.find('table:not(:has(tbody))')) { - $(table).contents().wrap('
'); + $(table).contents().wrap(''); } // Children will only take 100% height if the parent has a height property. for (const node of $editable.find('*').filter((i, n) => ( @@ -701,7 +701,15 @@ function formatTables($editable) { !n.parentElement.style.getPropertyValue('height') || n.parentElement.style.getPropertyValue('height').includes('%')) ))) { - node.parentElement.style.setProperty('height', '0'); + let parent = node.parentElement; + let height = parent.style.getPropertyValue('height'); + while (parent && height && height.includes('%')) { + parent = parent.parentElement; + height = parent.style.getPropertyValue('height'); + } + if (parent) { + parent.style.setProperty('height', '0'); + } } }