summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-04-17 19:47:37 +0200
committerChristophe Simonis <chs@odoo.com>2019-04-17 19:47:37 +0200
commit15b8d353c7bcee7279a06a1dc4d03e8c259cc2f2 (patch)
treeb8018bfee69bd053674451f6eb0cfedaf0021e88 /addons/web_editor/static/src/js
parent2b63b7e8edfd052682bb01be7a2b4f66c1f6e8fb (diff)
parent2830b93a3a7ca575bd6a29c34c50c902bb5c8913 (diff)
[MERGE] forward port branch 12.0 up to 2830b93a3a7
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/summernote.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js
index 36f5becce06..71130f54afb 100644
--- a/addons/web_editor/static/src/js/editor/summernote.js
+++ b/addons/web_editor/static/src/js/editor/summernote.js
@@ -1259,9 +1259,11 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
} else {
node = dom.splitTree(last, {'node': r.sc, 'offset': r.so}) || r.sc;
if (!contentBefore) {
+ // dom.node chooses the parent if node is text
var cur = dom.node(dom.lastChild(node.previousSibling));
if (!dom.isBR(cur)) {
- $(cur).html(br);
+ // We should concat what was before with a <br>
+ $(cur).html(cur.innerHTML + br.outerHTML);
}
}
if (!dom.isVisibleText(node)) {