From e712d872ac219cd12ce1e7686f20242e0985146e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 22 Dec 2016 14:12:13 +0100 Subject: [PATCH] Prevent superfluous `
` in `
`

---
 .../install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js   | 5 +++++
 1 file changed, 5 insertions(+)

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);
-- 
2.20.1