From d35368039c037f27a2146a0cddbd8b0ce43865e9 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Sat, 19 Sep 2015 22:36:15 +0200 Subject: [PATCH] non-breaking space after mentions --- js/qvitter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/qvitter.js b/js/qvitter.js index c2a89ab..11b2a4a 100644 --- a/js/qvitter.js +++ b/js/qvitter.js @@ -2603,7 +2603,7 @@ function useSelectedMention(queetBox){ // replace the halfwritten username with the one we want deleteBetweenCharacterIndices(queetBox[0], window.lastMention.mentionPos+1, window.lastMention.cursorPos); var range = createRangeFromCharacterIndices(queetBox[0], window.lastMention.mentionPos+1, window.lastMention.mentionPos+1); - range.insertNode(document.createTextNode(username + ' ')); + range.insertNode(document.createTextNode(username + '\u00a0')); // non-breaking-space, to prevent collapse // put caret after setSelectionRange(queetBox[0], window.lastMention.mentionPos+username.length+2, window.lastMention.mentionPos+username.length+2);