summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2017-01-11 10:35:03 +0100
committerNicolas Lempereur <nle@odoo.com>2017-01-11 10:38:29 +0100
commit2c66f7bc7f3b84d5386a3ab6866aa4349ea0a1c0 (patch)
tree77e55b08c17435df6114637626883a355713ed08 /addons/web_editor/static/src/js
parentcd4ff9341e8a1bf9ca383b43facba573204f9fa1 (diff)
[FIX] web_editor: italic odd behavior because typo
An italic node would be taken as a basic node containing text and thus would be merged unexpectedly. For example with the following content : "<i>hello</i> world" removing a letter of 'world' would merge the text node with hello making it italic. opw-703722
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/summernote.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index e08f0680663..51dd3df97ed 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -134,7 +134,7 @@ dom.hasProgrammaticStyle = function (node) {
};
dom.mergeFilter = function (prev, cur, parent) {
// merge text nodes
- if (prev && (dom.isText(prev) || ("H1 H2 H3 H4 H5 H6 LI P".indexOf(prev.tagName) !== -1 && prev !== cur.parentNode)) && dom.isText(cur)) {
+ if (prev && (dom.isText(prev) || (['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'LI', 'P'].indexOf(prev.tagName) !== -1 && prev !== cur.parentNode)) && dom.isText(cur)) {
return true;
}
if (prev && prev.tagName === "P" && dom.isText(cur)) {