Avoid newline duplication when pasting from Word
authorAlexander Ebert <ebert@woltlab.com>
Fri, 10 Nov 2017 15:26:43 +0000 (16:26 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 10 Nov 2017 15:26:43 +0000 (16:26 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js

index 23b79b071c0aac8b257acc054e21ef1c2debd41f..2cdae78a0d8248a6c5b92b812cf027e8f91b6341 100644 (file)
@@ -242,7 +242,7 @@ $.Redactor.prototype.WoltLabClean = function() {
                                
                                html = mpOnPaste.call(this, div.innerHTML, data, insert);
                                
-                               html = html.replace(/@@@WOLTLAB-BR-MARKER@@@/g, '<woltlab-br-marker></woltlab-br-marker>');
+                               html = html.replace(/\n*@@@WOLTLAB-BR-MARKER@@@/g, '<woltlab-br-marker></woltlab-br-marker>');
                                html = html.replace(/(<p>)?\s*@@@WOLTLAB-P-ALIGN-(left|right|center|justify)@@@/g, function (match, p, alignment) {
                                        if (p) {
                                                return '<p class="text-' + alignment + '">';