Pasting code into a code box caused duplicates
authorAlexander Ebert <ebert@woltlab.com>
Mon, 25 Apr 2022 17:24:37 +0000 (19:24 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 25 Apr 2022 17:24:37 +0000 (19:24 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabPaste.js

index ddc29199ef51ea64926302c6ff862042553f0e88..34ad8c13855b4c39acebe94bc16f487d79cc4f59 100644 (file)
@@ -58,6 +58,8 @@ $.Redactor.prototype.WoltLabPaste = function() {
                                var isCode = (this.opts.type === 'pre' || this.utils.isCurrentOrParent('pre'));
                                isKbd = (!isCode && this.utils.isCurrentOrParent('kbd'));
                                if (isCode || isKbd) {
+                                       e.preventDefault();
+
                                        if (isIe) {
                                                clipboardData = window.clipboardData.getData('Text');
                                        }