From b2f1d72a036a4d191d6cee20efb3c62b338e28ee Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Mon, 10 Jul 2023 10:16:39 +0000 Subject: [PATCH] [FIX] web_editor: properly set image width attributes A semi-colon unfortunately took the place of a double pipe in code that retrieves an image's width in order to set its width attribute. This led to some images being wrongly sized. opw-3299392 X-original-commit: 0a21da39f05ef9ec9d202424e0e648849f44e164 Part-of: odoo/odoo#129153 --- addons/web_editor/static/src/js/backend/convert_inline.js | 2 +- 1 file changed, 1 insertion(+), 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 074350f40ca..670d72083ea 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -734,7 +734,7 @@ async function toInline($editable, cssRules, $iframe) { for (const image of images) { if (image.style[attributeName] !== 'auto') { const value = image.getAttribute(attributeName) || - (attributeName === 'height' && image.offsetHeight); + (attributeName === 'height' && image.offsetHeight) || (attributeName === 'width' ? _getWidth(image) : _getHeight(image)); if (value) { image.setAttribute(attributeName, value);