From: Alexander Ebert Date: Mon, 5 Dec 2016 11:40:17 +0000 (+0100) Subject: Fixed newline handling on paste X-Git-Tag: 3.0.0_RC_1~87 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=49260242c329ca103be4e637f71a52abbaf65d60;p=GitHub%2FWoltLab%2FWCF.git Fixed newline handling on paste --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js index 40070d235f..687ecbc4fb 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js @@ -150,7 +150,7 @@ $.Redactor.prototype.WoltLabClean = function() { }); elBySelAll('br', div, function (br) { - br.parentNode.insertBefore(document.createTextNode('@@@WOLTLAB-BR-MARKER@@@'), br); + br.parentNode.insertBefore(document.createTextNode('@@@WOLTLAB-BR-MARKER@@@'), br.nextSibling); }); html = mpOnPaste.call(this, div.innerHTML, data, insert); @@ -167,14 +167,13 @@ $.Redactor.prototype.WoltLabClean = function() { while (marker.nextSibling) { p.appendChild(marker.nextSibling); } - p.appendChild(elCreate('br')); - parent.parentNode.insertBefore(p, parent.nextSibling); - - var previous = marker.previousElementSibling; + var previous = marker.previousSibling; if (previous && previous.nodeName === 'BR') { elRemove(previous); } + + parent.parentNode.insertBefore(p, parent.nextSibling); } else { parent.insertBefore(elCreate('br'), marker);