From cc90b972f8790d13ad3d57591c29de30f5145a27 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Mon, 10 Jan 2022 16:33:10 +0000 Subject: [PATCH] [FIX] web_editor: prevent useless tbodys on convert When converting, we ensure each table has a tbody but inadvertently were wrapping each in a separate tbody rather than wrapping all the contents of the table. Part-of: odoo/odoo#83233 --- addons/web_editor/static/src/js/backend/convert_inline.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 98ca47c9d36..6753fae8ff3 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -495,7 +495,9 @@ 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(''); + const $contents = $(table).contents(); + $(table).prepend(''); + $(table.firstChild).append($contents); } // Children will only take 100% height if the parent has a height property. for (const node of $editable.find('*').filter((i, n) => (