Newline recognition for the new code highlighter
authorAlexander Ebert <ebert@woltlab.com>
Fri, 11 Jan 2019 16:45:24 +0000 (17:45 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 11 Jan 2019 16:45:24 +0000 (17:45 +0100)
See #2800

wcfsetup/install/files/js/WCF.Message.js

index bd9d8a3837f48e191e764d49f1bce392f33663c8..cdb140c01d8181de3f3cdac3433f8891f788faa6 100644 (file)
@@ -1221,7 +1221,7 @@ if (COMPILER_TARGET_DEFAULT) {
                                                                $text += "\n";
                                                        }
                                                        break;
-                                               
+                                                       
                                                case 'P':
                                                        $text += "\n\n";
                                                        break;
@@ -1230,6 +1230,13 @@ if (COMPILER_TARGET_DEFAULT) {
                                                case 'IMG':
                                                        $text += " " + $node.alt + " ";
                                                        break;
+                                                       
+                                               // Code listing
+                                               case 'DIV':
+                                                       if ($node.classList.contains('codeBoxHeadline') || $node.classList.contains('codeBoxLine')) {
+                                                               $text += "\n";
+                                                       }
+                                                       break;
                                        }
                                }
                                else {