From e68a37f3792eb6d9e67c9bc61207965b0bf2987e Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Mon, 11 Jan 2021 11:12:48 +0000 Subject: [PATCH] [FIX] web_editor: fix steps snippet line removed when change icon bg-col Previously, when changing the background-color of an icon in the s_process_steps snippet, the line that goes through the snippet would disappear from that block. This was caused by our font-application code attempting to remove extraneous DOM nodes when changing a font color or backrgound-color, but not considering elements with a ::before or ::after pseudoelement has having content, and subsequently removing them. opw-2423785 closes odoo/odoo#64412 X-original-commit: 6b363d202d9c35e8249f7bb2b0730b995fdf4a7d Signed-off-by: Samuel Degueldre --- addons/web_editor/static/src/js/editor/summernote.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js index f1145c8d8c1..f99bae3030f 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -2260,7 +2260,8 @@ $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color } // remove node without attributes (move content), and merge the same nodes - var className2, style, style2; + var className2, style, style2, hasBefore, hasAfter; + var noContent = ['none', null, undefined]; for (i=0; i