From: Alexander Ebert Date: Tue, 5 Nov 2019 15:16:29 +0000 (+0100) Subject: Replace `
` inside dynamically converted code elements X-Git-Tag: 5.2.0_Beta_3~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aed8e1d8e92d5d8ffc612da950e2c2f6fd981071;p=GitHub%2FWoltLab%2FWCF.git Replace `
` inside dynamically converted code elements --- 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);