From 901ea22478cc3daf7d554c21b00e13859cbec115 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 22 Dec 2016 12:29:59 +0100 Subject: [PATCH] Work-around for code being stripped from pasted data --- .../js/3rdParty/redactor2/plugins/WoltLabClean.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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'); -- 2.20.1