From 5cb6ad8f031af3c3321e5bf7c2a47ea21dbe4964 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 25 Sep 2015 13:11:21 +0200 Subject: [PATCH] Fix for pasting on iOS --- .../files/js/3rdParty/redactor/plugins/wmonkeypatch.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); -- 2.20.1