From 4b49303c0a06d13efa9eb50d13202ea2797b4688 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 17 May 2021 12:10:49 +0200 Subject: [PATCH] Skip basic bbcodes when the selection is inside a code block --- .../files/js/3rdParty/redactor2/plugins/WoltLabButton.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js index 15cba9f2f6..5cc089ab65 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js @@ -156,6 +156,11 @@ $.Redactor.prototype.WoltLabButton = function() { WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'bbcode_' + bbcode + '_' + this.$element[0].id, data); if (data.cancel !== true) { + const block = this.selection.block(); + if (block && block.nodeName === "PRE") { + return; + } + this.buffer.set(); var marker = this.marker.get(); -- 2.20.1