From 2ef6e249d0da4aaf1ebc6c1b24d16060cb2e3f9d Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 20 Jan 2016 11:04:22 +0100 Subject: [FIX] web_editor: merge span when paste, only if no content between tags opw-667263 --- .../web_editor/static/lib/summernote/src/js/module/Clipboard.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'addons/web_editor/static/lib/summernote/src/js/module') diff --git a/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js b/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js index 419f52c8fc3..8b42726ff7a 100644 --- a/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js +++ b/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js @@ -150,6 +150,14 @@ define([ $(this).replaceWith($(this).contents()); }); $node.find('span + span').each(function () { + + if (dom.isText(this.previousSibling)) { + if (dom.isVisibleText(this.previousSibling)) { + return; + } else { // keep space between 2 tags, but can merge the both tags + $(this).prev().append(this.previousSibling); + } + } if ($(this).attr('class') === $(this).prev().attr('class') && $(this).attr('style') === $(this).prev().attr('style')) { $(this).prev().append($(this).contents()); $(this).remove(); -- cgit v1.2.3