From: Alexander Ebert Date: Thu, 22 Dec 2016 11:29:59 +0000 (+0100) Subject: Work-around for code being stripped from pasted data X-Git-Tag: 3.0.0_RC_3~78 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=901ea22478cc3daf7d554c21b00e13859cbec115;p=GitHub%2FWoltLab%2FWCF.git Work-around for code being stripped from pasted data --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js index 852ce1b8a4..9736d864c1 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js @@ -107,7 +107,15 @@ $.Redactor.prototype.WoltLabClean = function() { var mpOnPaste = this.clean.onPaste; this.clean.onPaste = (function (html, data, insert) { if (data.pre) { - return mpOnPaste.call(this, html, data, insert); + // prevent method call when data.pre is true + var mpRemoveEmptyInlineTags = this.clean.removeEmptyInlineTags; + this.clean.removeEmptyInlineTags = function(html) { return html; }; + + html = mpOnPaste.call(this, html, data, insert); + + this.clean.removeEmptyInlineTags = mpRemoveEmptyInlineTags; + + return html; } var div = elCreate('div');