[FIX] web_editor: merge span when paste, only if no content between tags

opw-667263
This commit is contained in:
Christophe Matthieu
2016-01-20 13:23:23 +01:00
parent 86b80689d7
commit 2ef6e249d0
@@ -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();