[FIX] web_editor: ensure <font> colors are kept properly

Color and background-color styles on `<font>` tags were being wrongly overridden when applying another color or background color to the element.

Task-2580158

(cherry picked from commit a532d096faf55550ac6d01795aaa2b6843ebc988)
This commit is contained in:
Sébastien Geelen (sge)
2021-07-13 07:38:49 +00:00
parent 1cd9660cfc
commit 0d4a21bae5
@@ -498,7 +498,7 @@ export const editorCommands = {
// Color the selected <font>s and remove uncolored fonts.
for (const font of new Set(fonts)) {
colorElement(font, color, mode);
if (!hasColor(font, mode) && !hasColor(font, mode)) {
if (!hasColor(font, mode) && !font.hasAttribute('style')) {
for (const child of [...font.childNodes]) {
font.parentNode.insertBefore(child, font);
}