From: Alexander Ebert Date: Mon, 17 May 2021 10:10:49 +0000 (+0200) Subject: Skip basic bbcodes when the selection is inside a code block X-Git-Tag: 5.4.0_Alpha_3~31 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b49303c0a06d13efa9eb50d13202ea2797b4688;p=GitHub%2FWoltLab%2FWCF.git Skip basic bbcodes when the selection is inside a code block --- 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();