summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js b/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js
index 141d4c1bf2e..9ac05220e45 100644
--- a/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js
+++ b/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js
@@ -827,7 +827,7 @@ var KeyboardPlugin = AbstractPlugin.extend({
}
},
/**
- * Remove the first unbreakable ancestor's next sibling if empty.
+ * Remove the first unbreakable ancestor's next sibling if not a block and empty.
*
* @private
* @param {Node} node
@@ -843,7 +843,7 @@ var KeyboardPlugin = AbstractPlugin.extend({
var isNextContainsOnlyInvisibleText = nextUnbreakable && _.all($(nextUnbreakable).contents(), function (n) {
return dom.isText(n) && !self.context.invoke('HelperPlugin.isVisibleText', n);
});
- if (isNextEmpty || isNextContainsOnlyInvisibleText) {
+ if (!dom.isBlock(nextUnbreakable) && (isNextEmpty || isNextContainsOnlyInvisibleText)) {
$(nextUnbreakable).remove();
}
},