Improved newline handling for tables
authorAlexander Ebert <ebert@woltlab.com>
Sun, 28 Jun 2015 10:04:48 +0000 (12:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 28 Jun 2015 10:04:48 +0000 (12:04 +0200)
wcfsetup/install/files/js/WoltLab/WCF/BBCode/FromHtml.js
wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js

index 2ce1f0542be92e25f0b8149aebe077c77cf30f81..583a9d0acc6a0052449a446284590f107af047cb 100644 (file)
@@ -216,7 +216,7 @@ define(['DOM/Traverse'], function(DOMTraverse) {
                        
                        var tbody = DOMTraverse.childByTag(element, 'TBODY');
                        var innerHtml = (tbody === null) ? element.innerHTML : tbody.innerHTML;
-                       element.outerHTML = '\n[table]' + innerHtml + '\n[/table]';
+                       element.outerHTML = '\n[table]' + innerHtml + '\n[/table]\n';
                },
                
                _convertUrl: function(element) {
index 796dd30871b703ab7ee28109b58db02833fa80c5..b5c02461bd6028e447621cac7112041397d57903 100644 (file)
@@ -82,7 +82,7 @@ define(['WoltLab/WCF/BBCode/Parser'], function(BBCodeParser) {
                                        stack[index + 1] = tmp.replace(/^\n/, '');
                                }
                                
-                               if (stack.length < item.pair + 1) {
+                               if (stack.length > item.pair + 1) {
                                        tmp = stack[item.pair + 1];
                                        if (typeof tmp === 'string') {
                                                stack[item.pair + 1] = tmp.replace(/^\n/, '');