From 72a842b540b1e17c4014de79c4a6a45e65d2f315 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 23 May 2016 12:59:58 +0200 Subject: [PATCH] Removed double separators for link tooltips --- .../3rdParty/redactor/plugins/wmonkeypatch.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 8606c10e0a..6146decf67 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -1164,6 +1164,26 @@ RedactorPlugins.wmonkeypatch = function() { if (!$link.hasClass('redactorQuoteEdit')) { $mpShowTooltip.call(this, e); } + + // remove pipe ("|") separators + $('.redactor-link-tooltip').each(function(index, tooltip) { + var textNodes = [], i, length, node; + for (i = 0, length = tooltip.childNodes.length; i < length; i++) { + node = tooltip.childNodes[i]; + + if (node.nodeType === Node.TEXT_NODE) { + textNodes.push(node); + } + } + + for (i = 0, length = textNodes.length; i < length; i++) { + node = textNodes[i]; + + if (node.textContent.trim() === '|') { + node.parentNode.removeChild(node); + } + } + }); }).bind(this); }, -- 2.20.1