Fixed empty lines in code boxes being removed
authorAlexander Ebert <ebert@woltlab.com>
Mon, 23 Jan 2017 17:44:50 +0000 (18:44 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 23 Jan 2017 17:44:50 +0000 (18:44 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 1fd74f42298a9a1a3693c089ea6a88cd3fd3b50c..000b74f1b651e499e685361f9c0e294372137bd7 100644 (file)
@@ -2485,8 +2485,10 @@ RedactorPlugins.wbbcode = function() {
                                        
                                        $codeBoxContent = $codeBoxContent.split('\n');
                                        var $codeContent = '';
+                                       var $line;
                                        for (var $i = 0; $i < $codeBoxContent.length; $i++) {
-                                               $codeContent += '<li>' + WCF.String.escapeHTML($codeBoxContent[$i]) + '</li>';
+                                               $line = $codeBoxContent[$i];
+                                               $codeContent += '<li>' + ($line.length ? WCF.String.escapeHTML($line) : this.opts.invisibleSpace) + '</li>';
                                        }
                                        $list.append($($codeContent));