From: Alexander Ebert Date: Wed, 24 Aug 2016 09:09:53 +0000 (+0200) Subject: Fixed encoding issues with pasted code X-Git-Tag: 3.0.0_Beta_1~540 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a089bce763f1bcc1da3a8d90a1152a39c7d0f5e;p=GitHub%2FWoltLab%2FWCF.git Fixed encoding issues with pasted code --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index c43230fdea..aa9bf0fda4 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -14,6 +14,7 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabBlock.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabButton.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCaret.js?v={@LAST_UPDATE_TIME}', + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabClean.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCode.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabColor.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDropdown.js?v={@LAST_UPDATE_TIME}', @@ -162,6 +163,7 @@ 'WoltLabAttachment', 'WoltLabAutosave', 'WoltLabCaret', + 'WoltLabClean', 'WoltLabCode', 'WoltLabColor', 'WoltLabDropdown', diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js new file mode 100644 index 0000000000..383a377908 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js @@ -0,0 +1,59 @@ +$.Redactor.prototype.WoltLabClean = function() { + "use strict"; + + return { + init: function () { + var mpOnSet = this.clean.onSet; + this.clean.onSet = (function (html) { + return mpOnSet.call(this, html.replace(/\u200B/g, '')); + }).bind(this); + + var mpOnSync = this.clean.onSync; + this.clean.onSync = (function (html) { + var div, replacements = {}; + if (html.indexOf('