From e269eb075fb2ecb04d4e8b3020b745e4b9973a72 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 28 Oct 2016 13:08:21 +0200 Subject: [PATCH] Fixed pasting of empty lines from Microsoft Word --- .../files/js/3rdParty/redactor2/plugins/WoltLabClean.js | 7 +++++++ 1 file changed, 7 insertions(+) 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); }); -- 2.20.1