From 9f342faac708e2c917b77873a189d52782fd0c7b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 28 Jun 2015 12:04:48 +0200 Subject: [PATCH] Improved newline handling for tables --- wcfsetup/install/files/js/WoltLab/WCF/BBCode/FromHtml.js | 2 +- wcfsetup/install/files/js/WoltLab/WCF/BBCode/ToHtml.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/, ''); -- 2.20.1