summaryrefslogtreecommitdiff
path: root/addons/web_editor/static
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2016-01-20 11:04:22 +0100
committerChristophe Matthieu <chm@odoo.com>2016-01-20 13:23:23 +0100
commit2ef6e249d0da4aaf1ebc6c1b24d16060cb2e3f9d (patch)
treeab00284753ee2e8f45ca1466634c04fb2bfd4d2e /addons/web_editor/static
parent86b80689d712a3afb2e4119cbdaab896c8721599 (diff)
[FIX] web_editor: merge span when paste, only if no content between tags
opw-667263
Diffstat (limited to 'addons/web_editor/static')
-rw-r--r--addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js8
1 files changed, 8 insertions, 0 deletions
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();