From 95df3329dd14d9f1893a7a86fa6ff7cd9d0db68f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 23 Jan 2017 17:48:03 +0100 Subject: [PATCH] Fixed detection of relative caret position --- wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index 81453a2085..957c223e3e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -815,6 +815,11 @@ RedactorPlugins.wutil = function() { return false; } + // check if caret is there are child nodes beyond the current end offset + if ($range.endContainer.childNodes.length > $range.endOffset) { + return false; + } + if ($range.endContainer.nodeType === Element.TEXT_NODE) { // caret is not at the end if ($range.endOffset < $range.endContainer.length) { -- 2.20.1