From: Alexander Ebert Date: Fri, 25 Sep 2015 11:11:21 +0000 (+0200) Subject: Fix for pasting on iOS X-Git-Tag: 2.1.8~36 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5cb6ad8f031af3c3321e5bf7c2a47ea21dbe4964;p=GitHub%2FWoltLab%2FWCF.git Fix for pasting on iOS --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 0ebcb2c6e6..92531a9655 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -1210,7 +1210,13 @@ RedactorPlugins.wmonkeypatch = function() { $node = marker.previousSibling; } - $(marker).remove(); + // iOS sometimes pastes right into the marker, this work-around will unwrap the pasted content + if (marker.innerHTML.length) { + marker.outerHTML = marker.innerHTML; + } + else { + marker.parentNode.removeChild(marker); + } if ($node !== null) { this.selection.implicitRange = document.createRange();