From 2c66f7bc7f3b84d5386a3ab6866aa4349ea0a1c0 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 11 Jan 2017 10:35:03 +0100 Subject: [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 : "hello world" removing a letter of 'world' would merge the text node with hello making it italic. opw-703722 --- addons/web_editor/static/src/js/summernote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/js') 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)) { -- cgit v1.2.3