summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/web_editor/static/src/js/editor/summernote.js7
1 files 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 290918a9563..3b49d1d8b4b 100644
--- a/addons/web_editor/static/src/js/editor/summernote.js
+++ b/addons/web_editor/static/src/js/editor/summernote.js
@@ -2261,7 +2261,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<nodes.length; i++) {
node = nodes[i];
@@ -2280,8 +2281,10 @@ $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color
$font = $(node);
className = dom.orderClass(node);
style = dom.orderStyle(node);
+ hasBefore = noContent.indexOf(window.getComputedStyle(node, '::before').content) === -1;
+ hasAfter = noContent.indexOf(window.getComputedStyle(node, '::after').content) === -1;
- if (!className && !style) {
+ if (!className && !style && !hasBefore && !hasAfter) {
remove(node, node.parentNode);
continue;
}