[FIX] website: font color on figure

Before this commit:

While applying font color, when multiple picture snippet is selected the
color was not properly applied to the selection. It was observed that the
font was unintentionally applied around the figure which was preventing the
proper application of selected color.

After this commit:

It has been made sure that whenever the figure element is enountered it
should not be appended inside font tag.

task-3640901

closes odoo/odoo#152660

X-original-commit: 09a9dede95fbcc230a468913d188988cb9ad01e2
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
This commit is contained in:
shsa-odoo
2024-02-05 16:32:53 +00:00
parent 1071ca71b1
commit aa374e2fc1
@@ -620,6 +620,7 @@ export const editorCommands = {
} else if ((node.nodeType === Node.TEXT_NODE && !isWhitespace(node))
|| (node.nodeName === 'BR' && isEmptyBlock(node.parentNode))
|| (node.nodeType === Node.ELEMENT_NODE &&
node.nodeName !== 'FIGURE' &&
['inline', 'inline-block'].includes(getComputedStyle(node).display) &&
!isWhitespace(node.textContent) &&
!node.classList.contains('btn') &&