From: Alexander Ebert Date: Sun, 28 Jun 2015 10:04:48 +0000 (+0200) Subject: Improved newline handling for tables X-Git-Tag: 3.0.0_Beta_1~2231 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f342faac708e2c917b77873a189d52782fd0c7b;p=GitHub%2FWoltLab%2FWCF.git Improved newline handling for tables --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/BBCode/FromHtml.js b/wcfsetup/install/files/js/WoltLab/WCF/BBCode/FromHtml.js index 2ce1f0542b..583a9d0acc 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/BBCode/FromHtml.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/BBCode/FromHtml.js @@ -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) { diff --git a/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js b/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js index 796dd30871..b5c02461bd 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js @@ -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/, '');