From: Alexander Ebert Date: Fri, 28 Oct 2016 11:08:21 +0000 (+0200) Subject: Fixed pasting of empty lines from Microsoft Word X-Git-Tag: 3.0.0_Beta_5~93 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e269eb075fb2ecb04d4e8b3020b745e4b9973a72;p=GitHub%2FWoltLab%2FWCF.git Fixed pasting of empty lines from Microsoft Word --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js index 5ce312b49e..17e789a2a3 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js @@ -133,6 +133,13 @@ $.Redactor.prototype.WoltLabClean = function() { } }); + // Empty lines in Microsoft Word are represented with   + elBySelAll('p.MsoNormal', div, function (p) { + if (p.childElementCount === 1 && p.children[0].nodeName === 'O:P' && p.textContent === '\u00A0') { + p.innerHTML = '
'; + } + }); + elBySelAll('br', div, function (br) { br.parentNode.insertBefore(document.createTextNode('@@@WOLTLAB-BR-MARKER@@@'), br); });