From fe2496350ce13e1dadb54102893abeb92747005d Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Thu, 25 Apr 2019 10:41:15 +0000 Subject: [PATCH] [FIX] web_editor: properly paste text in non-HTML fields This resolves an issue with pasting in text only mode (no HTML): the list of nodes to paste was being modified with the `_mergeAdjacentULs` method which is irrelevant to text nodes. Because of that, a corrupted list of nodes was inserted into the DOM. opw-1962743 closes odoo/odoo#32454 Signed-off-by: Pierre Paridans --- addons/web_editor/static/src/js/wysiwyg/plugin/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/text.js b/addons/web_editor/static/src/js/wysiwyg/plugin/text.js index d3ac908c507..16e22939cd4 100644 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/text.js +++ b/addons/web_editor/static/src/js/wysiwyg/plugin/text.js @@ -85,7 +85,7 @@ var TextPlugin = AbstractPlugin.extend({ return; } nodes = textOnly ? this.document.createTextNode($(nodes).text()) : nodes; - nodes = this._mergeAdjacentULs(nodes); + nodes = textOnly ? nodes : this._mergeAdjacentULs(nodes); var point = this._getPastePoint(); // Prevent pasting HTML within a link: