From 20cc74b066339f57d7e86cecd6d58b261547b29a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 17 Oct 2022 13:45:05 +0200 Subject: [PATCH] Improve message html element style width value --- dev/Common/Html.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dev/Common/Html.js b/dev/Common/Html.js index 997823486..8b11c7076 100644 --- a/dev/Common/Html.js +++ b/dev/Common/Html.js @@ -224,12 +224,16 @@ export const // if ('TABLE' === name || 'TD' === name || 'TH' === name) { if (!oStyle.backgroundImage) { + value = oStyle.width; if (hasAttribute('width')) { - value = getAttribute('width'); - oStyle.width = value.includes('%') ? value : value + 'px'; + if (!value) { + value = getAttribute('width'); + if (1 < pInt(value)) { + oStyle.width = value.includes('%') ? value : value + 'px'; + } + } delAttribute('width'); } - value = oStyle.width; if (value && !value.includes('%')) { oStyle.maxWidth = value; if ('TD' !== name && 'TH' !== name) { @@ -238,7 +242,9 @@ export const } if (hasAttribute('height')) { value = getAttribute('height'); - oStyle.height = value.includes('%') ? value : value + 'px'; + if (pInt(value)) { + oStyle.height = value.includes('%') ? value : value + 'px'; + } delAttribute('height'); } value = oStyle.removeProperty('height');