});
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);
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);