From: Alexander Ebert Date: Thu, 22 Dec 2016 13:12:13 +0000 (+0100) Subject: Prevent superfluous `
` in `
`
X-Git-Tag: 3.0.0_RC_3~73
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e712d872ac219cd12ce1e7686f20242e0985146e;p=GitHub%2FWoltLab%2FWCF.git

Prevent superfluous `
` in `
`
---

diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js
index 84f6289fcb..9fd764832b 100644
--- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js
+++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js
@@ -53,6 +53,11 @@ define(['EventHandler', 'EventKey', 'Language', 'StringUtil', 'Dom/Util', 'Ui/Di
 			
 			var pre = this._editor.selection.block();
 			if (pre && pre.nodeName === 'PRE') {
+				if (pre.childElementCount === 1 && pre.children[0].nodeName === 'BR') {
+					// drop superfluous linebreak
+					pre.removeChild(pre.children[0]);
+				}
+				
 				this._setTitle(pre);
 				
 				pre.addEventListener(WCF_CLICK_EVENT, this._callbackEdit);