From aed8e1d8e92d5d8ffc612da950e2c2f6fd981071 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 5 Nov 2019 16:16:29 +0100 Subject: [PATCH] Replace `
` inside dynamically converted code elements --- .../files/js/3rdParty/redactor2/plugins/WoltLabBlock.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js index 15b206078a..8055e38805 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js @@ -168,6 +168,14 @@ $.Redactor.prototype.WoltLabBlock = function() { elRemove(block); } } + + // Convert any `
` inside `
` with a plain newline character.
+				if (firstBlock) {
+					elBySelAll('br', firstBlock, function(br) {
+						br.parentNode.insertBefore(document.createTextNode('\n'), br);
+						elRemove(br);
+					});
+				}
 				
 				return $(firstBlock);
 			}).bind(this);
-- 
2.20.1