Fixed empty lines w/ formatting not being displayed properly
authorAlexander Ebert <ebert@woltlab.com>
Sun, 22 Mar 2015 23:40:46 +0000 (00:40 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 22 Mar 2015 23:40:46 +0000 (00:40 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 1c7833a7fe7b0b06192af04879b8e2e909b606a9..5b95f046e546a41e6d52d704c7016a7484fa3833 100644 (file)
@@ -1438,9 +1438,13 @@ RedactorPlugins.wbbcode = function() {
                        content = '';
                        
                        for (var $i = 0, $length = $tmp.length; $i < $length; $i++) {
-                               if (content.length) content += '\n';
+                               var $line = $tmp[$i];
+                               if ($line.length === 0) {
+                                       $line = this.opts.invisibleSpace;
+                               }
                                
-                               content += openingTag + $tmp[$i] + closingTag;
+                               if (content.length) content += '\n';
+                               content += openingTag + $line + closingTag;
                        }
                        
                        return content;