diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index f2657d243..60971d9ab 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -42,10 +42,7 @@ return false; }, select: function(event, ui) { - var terms = this.value.match(/\S+/g); - terms.pop(); - terms.push(ui.item.value); - this.value = terms.join(" ") + " "; + this.value = this.value.replace(/\S+\s*$/g, ui.item.value + " "); return false; }, source: function(req, resp) {