From 6d2c96e7455d14bc296ba2f142a1b58ef5bb0056 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 3 Dec 2014 19:29:18 +0100 Subject: [PATCH] Add JavaScript support for a024d6a4 --- wcfsetup/install/files/js/WCF.Message.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index c2ae4f5b13..450b50f94b 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -3627,16 +3627,23 @@ WCF.Message.UserMention = Class.extend({ // remove unicode zero width space and non-breaking space var $textBackup = $text; $text = ''; + var $hadSpace = false; for (var $i = 0; $i < $textBackup.length; $i++) { var $byte = $textBackup.charCodeAt($i).toString(16); - if ($byte != '200b' && !/\s/.test($textBackup[$i])) { + if ($byte != '200b' && (!/\s/.test($textBackup[$i]) || (($byte == 'a0' || $byte == '20') && !$hadSpace))) { + if ($byte == 'a0' || $byte == '20') { + $hadSpace = true; + } + if ($textBackup[$i] === '@' && $i && /\s/.test($textBackup[$i - 1])) { + $hadSpace = false; $text = ''; } $text += $textBackup[$i]; } else { + $hadSpace = false; $text = ''; } } -- 2.20.1