Fixed pasting
authorAlexander Ebert <ebert@woltlab.com>
Fri, 19 Sep 2014 15:31:17 +0000 (17:31 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 19 Sep 2014 15:31:17 +0000 (17:31 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 96a9a142e73572deb8e04f27bfdc9ca9e90a64bb..5f737288b56ca6cfa0e320d693320ede22ae8feb 100644 (file)
@@ -815,6 +815,7 @@ RedactorPlugins.wbbcode = {
                // replace nested elements e.g. <div><p>...</p></div>
                html = html.replace(/<(div|p)([^>]+)?><(div|p)([^>]+)?>/g, '<p>');
                html = html.replace(/<\/(div|p)><\/(div|p)>/g, '</p>@@@wcf_break@@@');
+               html = html.replace(/<(div|p)><br><\/(div|p)>/g, '@@@wcf_break@@@');
                
                WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'beforePaste', { html: html });
                
@@ -835,7 +836,7 @@ RedactorPlugins.wbbcode = {
                html = html.replace(/<header[^>]*>/g, '');
                html = html.replace(/<\/header>/g, '');
                
-               html = html.replace(/<div>.*?<\/div>/g, '<p>$1</p>');
+               html = html.replace(/<div>(.*?)<\/div>/g, '<p>$1</p>');
                
                // drop lonely divs
                html = html.replace(/<\/?div>/g, '');