Fixed handling of empty lines
authorAlexander Ebert <ebert@woltlab.com>
Wed, 16 Nov 2016 14:46:45 +0000 (15:46 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 16 Nov 2016 15:14:15 +0000 (16:14 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js

index 17e789a2a302c86fb4f336231526692420414d0e..ab3b26466b15ab6babc6101932f0403a7d534d8f 100644 (file)
@@ -44,7 +44,7 @@ $.Redactor.prototype.WoltLabClean = function() {
                                        var br = p.lastElementChild;
                                        if (br && br.nodeName === 'BR') {
                                                // check if there is only whitespace afterwards
-                                               if (br.nextSibling && br.nextSibling.textContent.match(/^[\s\u200B]+$/)) {
+                                               if (br.nextSibling && br.nextSibling.textContent.replace(/[\r\n\t]/g, '').match(/^\u200B+$/)) {
                                                        var newP = elCreate('p');
                                                        newP.innerHTML = '<br>';
                                                        p.parentNode.insertBefore(newP, p.nextSibling);