summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-07-16 16:02:41 +0200
committerMartin Trigaux <mat@odoo.com>2019-07-16 16:36:40 +0200
commitbeba36416fdf25df74cf8a581c66948a418173b6 (patch)
treed24b8a373560afcc78bde4c9c06338800809abfa /addons/web_editor/static/src/js/wysiwyg/plugin/helper.js
parent044904b9d50d61c5c7e5432a1b4615dda145704c (diff)
parent40421be73c94551ba902856984c0155d062cb449 (diff)
[MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c94551b
Diffstat (limited to 'addons/web_editor/static/src/js/wysiwyg/plugin/helper.js')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/plugin/helper.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js b/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js
index a025d6a0082..1738e6e7b48 100644
--- a/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js
+++ b/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js
@@ -1885,6 +1885,9 @@ var HelperPlugin = AbstractPlugin.extend({
// Create empty text node to have a range into the node
if (range.sc.tagName && !dom.isVoid(range.sc) && !range.sc.childNodes[range.so]) {
$(range.sc).append(invisible);
+ if (invisible.previousSibling && invisible.previousSibling.tagName === "BR") {
+ invisible.previousSibling.remove();
+ }
range = this.context.invoke('editor.setRange', invisible, 0);
}